soaj
SOA in JavaScript.
Easily have a central application to dispatch URLs to the correct services.
Description
With a simple JSON configuration, define the routes and the HTTP services behind them. For example:
Will send all the requests matching /users
to 10.0.0.24:80
and all the
requests matching /articles
to 10.0.0.25:80
.
Features
- HTTP fully supported
- HTTPS services supported
- JavaScript regular expressions supported for route definitions (the route
is passed to
new RegExp()
)
Notable missing features:
- HTTPS server not supported
Installation
npm install soaj # to install the library only
npm install -g soaj # to install the application
Usage
Binary usage
$ soaj --help
Usage: soaj [OPTION...] ROUTES_FILE
-l IP_ADDRESS, --listen=IP_ADDRESS
Define the IP address on which the application must listen to.
Default value: 127.0.0.1
-p PORT, --port=PORT
Define the port on which the application must listen to.
Default value: 2504
API usage
var Soaj = ;var routes = ;var port = 2504;var ip = '127.0.0.1';routes;
Contributors
License
MIT License