-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Framework for large scale applications, supporting configuration file, services, routes, express middleware, client data.
This npm module addresses requirements of medium to large applications.
- Routes : for creating REST controllers,
- Services : for doing actual work ("providers"),
Routes and services are simple classes with optional "init()" functions. These classes are listed in a YAML file and loaded by nxn at boot time.
see sample below...
Install @nxn/boot cli nxg from npm:
npm install -g @nxn/cli
init the project:
nxg init
and install dependencies:
npm install
This creates following file structure:
- index.js : main file, that you never need to modify
- a basic README.md for your documentation
- client_data/default/config_default.yml : where all components are defined.
- package.json with dependencies and scripts.
- Dockerfile that should work for most cases.
Basically: index.js loads the application config_default.yml and initialises all components. Then it runs express (default server here).
##Run the generated sample:##
Run the sample:
node index.js
or
npm start
You should then see :
The application is then up and running.. It doesnt do much right now but everything is ready. Have a look on the config file and you'll see sections where routes, services, run, tests anf middleware will be listed.
Just to make sure Dowker is also ready to go, create the image and run it:
npm run docker
npm run docker:run
You should then see the image running as well if Docker is installed on your workstation.