That's right. You can create a module that will return a basic http server that implements settings / methods common to all of your services. From there, you can simply require this module and add additional maintenance methods.
The module will look something like this:
var express = require('express'); var app = express.createServer();
And then you can use this module as follows:
var service = require('./service-base').app; service.get('/users', function(req, res) {
If you need to expose other elements from the module, you can easily do this to make them available in the service implementation files.
source share