Bastl34 / expressy

Simple Node-Express based Webserver and Proxy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expressy

Expressy is a simple node-express based static webserver and proxy.

Expressy Logo

Howto

  • copy config.json.dist to config.json and apply your server settings
  • npm i
  • use forever, forver-service or whatever to let the server run forever

Commands

#start
npm run start

#validate config
npm run validate

Types

static

{
    "domain": "testtest1.com",
    "type": "static",
    "index": false,
    "target": "./test",
    "filter": ["**.php"]
}
  • if you want to enable directory listings: enable index

proxy

{
    "domain": "testtest2.com",
    "type": "proxy",
    "target": "127.0.0.1:8080"
}

alias

{
    "domain": "testtest3.com",
    "type": "alias",
    "target": "testtest2.com"
}

redirect

{
    "domain": "testtest4.com",
    "type": "redirect",
    "target": "https://google.com"
}

basic auth

{
    "domain": "testtest1.com",
    "type": "static",
    "index": false,
    "target": "./test",
    "basicAuth": { "user": "user", "password": "password", "title": "protected area" }
}

Wildcards

Filters

  • Filtered files are not served
  • all . files and . directories are filterd by default
  • You can define filters for "type": "static"
  • If you want to filter all php files in all directories:
    • "filter": ["**.php"]
  • Its based on micromatch:

run with forever service

#install dependencies
sudo npm install -g forever
sudo npm install -g forever-service

#add new service
cd expressy
sudo forever-service install expressy --script index.js --noGracefulShutdown --start

#if you want to uninstall the service
sudo forever-service delete expressy

About

Simple Node-Express based Webserver and Proxy


Languages

Language:JavaScript 100.0%