https://github.com/nugaon/nodejs-hapi-server
Basic backbone for a hapi http server
https://github.com/nugaon/nodejs-hapi-server
Last synced: over 1 year ago
JSON representation
Basic backbone for a hapi http server
- Host: GitHub
- URL: https://github.com/nugaon/nodejs-hapi-server
- Owner: nugaon
- Created: 2020-04-29T17:10:12.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-30T12:50:40.000Z (about 6 years ago)
- Last Synced: 2025-01-11T13:25:34.297Z (over 1 year ago)
- Language: TypeScript
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Description
This repository serves as a backbone at NodeJS HTTP sever projects.
It contains auto-generated documentation, payload/parameter checking,
dependency injection and many more basic requirements.
# Run
You can use Docker to build up every service that this server uses.
To do that run `./run-dev-dockerstack.sh` in the project's root directory.
As it is in its name, it should be used only for development purposes.
If you have anything or the server doesn't have any other service dependency use
> npm run dev
command.
# Build
For production you would like to build your project, which you can do by the
> npm run build
command. Webpack is used in this process, you can read its configuration in 'webpack.config.js'
# Route registry
If you would like to add or remove routes to this server, you can do that in the
[RouteRegistry](src/server/configuration/RouteRegistry.ts).
The definitions of the routes which are imported in the * * RouteRegistry * *
should be placed in the [application directory](src/application).
# Security
For the HTTP server security you must check and adjust
[ApplicationServerOptions](src/server/configuration/ApplicationServerOptions.ts).
# Commented Code Blocks
The codebase contains code blocks which are commented out for later usage like
* [Database](src/engine/components/Database.ts)
* [UserSessionRedisDb](src/engine/components/UserSessionRedisDb.ts)
and its calling statements.
# Process environment usage
The application uses the following environment variables:
* ENV # has to be 'production' or 'development'
# Documentation
For the API documentation the hapi's * * swagger * * plugin makes auto-generated
interactive descriptions.