EZBake
simplifies building a service
Built atop express.js, EZBake provides a convenient approach to building webservices.
Installation
npm install ezbake -S
Usage
With EZBake you define your endpoints in a JSON file like so:
Note the handler
is set to /handlers/root
. This points to a designated request handling module in the project. In this case it's in a directory called handlers
. Here's what root.js handler looks like:
module{res;}
Now it's time to do some baking. In our application we load the EZBake module via require("ezbake")
, create a instance, load up our endpoint and start the server.
var EZBake = ; var ez = ;ezez
That's it. You just need to run the app from your terminal:
node app
and you should see something like this:
initializing serviceconfiguring localhost environmentroute GET handler / => /running serviceserver started on %s:%d, Sat Oct 03 2015 12:15:30 GMT-0700 @ http://localhost::8000
Your service is running and and can be accessed via your browser.
The source code for this can be found in /example
directory of the project.