Git Product home page Git Product logo

servus's Introduction

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, ...]}
  }
};

servus's People

Contributors

shahata avatar

Watchers

 avatar  avatar  avatar

servus's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.