resize-server
resize-server copied to clipboard
Now resize-server is modular
I did several changes:
- Removed node_modules that were git tracked on the package
- Installed new dependencies, updating
expressto a more recent version, and usingbody-parserinstead ofexpress.bodyParser - Created and
index.jsfile that contains the code that was before onserver.js, but instead of running the server in that file, exporting an express.Router variable to allow modularity with other services. This means that resize-server can now be used by other express based apps. (more on this later) - Edited
server.jsto run the server as standalone if desired, withnpm start
Regarding the modularity, the creation of the index.js file means that on other server you could do:
let resizeApp = require('resize-server'); // or the name of the package on npm
let express = require('express');
let app = express();
app.use('/resize', resizeApp);
// run
app.listen(12345);