A simple web stack with Redis, ExpressJS & NodeJS.
The NodeJS app contains several files:
- server.js: contains server configurations and starts a process that listens on the desired ports.
- router.js: contains routing configurations.
- logger.js: contains a few basic logging functions.
- errorhandler.js: contains the error handling and routing configurations to error pages.
Node
NPM +
- compression
- cookie-parser
- ejs
- express
- helmet
- keygrip
- redis
Create a service in systemd (GNU/Linux) or homebrew (Mac). Note the port for Redis.
Adapt all configurations inside the server.js file.
Templates are generated from inside the router.js file.
Add static files such as scripts, css, favicon, apple-touch-icon, static html pages... to the public folder.
Possible improvements inculde
- a CMS interface to save data to a database and server.js file interaction with this database to generate templates, stored in Redis.