No description, website, or topics provided.
JavaScript
Switch branches/tags
Clone or download
Latest commit 7c0a771 Nov 9, 2013
Permalink
Failed to load latest commit information.
bin say my name! Sep 29, 2013
lib 1) added --init and --version flags. Sep 27, 2013
.gitignore initial project Jun 30, 2013
.jshintrc error handling Sep 19, 2013
.npmignore added files Jun 30, 2013
Gruntfile.js added grunt release Nov 9, 2013
README.md Update README.md Sep 27, 2013
package.json release 0.0.11 Nov 9, 2013
servus.conf.js 1) added --init and --version flags. Sep 27, 2013

README.md

servus

Servus (Slovak: Servus, Croatian: Serbus or Servus, Hungarian: Szervusz, Polish: Serwus, Austro-Bavarian: Servus, Romanian: Servus, Slovene: Serbus or Servus, Czech: Servus, Ukrainian: Сервус) is a salutation used in many parts of Central and Eastern Europe. It is a word of greeting or parting like the Italian "Ciao".

Servus is a simple connect based reverse proxy.

$ npm install -g servus
$ servus --init
$ servus

Map urls and filesystem folders to one servus server by simply adding servus.conf.js to your project and running servus.

  • It listens on the configured port and will find an available port in case the port is taken.
  • It can automatically open a browser window with a pre-defined URL when invoked.
  • It automatically restarts when the configuration file is updated.
  • It adds cors headers, gzip compress, navigates directories.
  • It can load any connect plugin you want, no matter if it is installed globally or locally. (see syntax below)
  • It will use servus.conf.js in the closest parent directory if one cannot be found in the current directory.
  • If servus.conf.js does not exist, it will run a simple web server, serving the current folder.

Sample servus.conf.js file:

module.exports = { //create your own servus.conf.js with --init
  port: 9000, //override in command line with --port ###
  gzip: true, //override in command line with --gzip or --no-gzip
  cors: true, //override in command line with --cors or --no-cors
  open: 'http://localhost:<%= port %>', //override in command line with --open URL or --no-open

  //add custom attributes and use them as template attributes throughout your config
  //override in command line using 'servus --stagingServer=sake' (the = is important)
  stagingServer: 'pizza',

  aliases: {
    //remote api server
    '/_api/': 'http://www.<%= stagingServer %>.wixpress.com/_api/',

    //local 'grunt server'
    '/_partials/wix-contacts-statics/latest/': 'http://localhost:9000/',

    //local tomcat server
    '/create/my-account': 'http://localhost:8080/wix-dashboard-ng-webapp/dashboard/',

    //local filesystem
    '/services/wix-dashboard-ng-static/': '../wix-dashboard-ng-static/src/main/static/'

    //need something special?
    //'/mapped/path/': {plugin: 'some-connect-plugin', args: [arg1, arg2, ...]}

    //or just add you connect function inline
    //'/mapped/path/': {plugin: function() {}, args: [arg1, arg2, ...]}
  }
};