This is Node.js CRUD Application
It consists following layers:-
- routes
- validators
- middlewares
- controllers
- services
- file-handling
Along with above main layers, it also contains various other sub-layers like:-
- constants
- lib
- providers
- utils
- scripts
-
Pre-requisites
node-crud-app requires Node.js v10+ to run.
Clone the project by copying below mentioned command into your directory :-
git clone https://github.com/malik106/node-crud-app
Change directory to ems by typing below mentioned command :-
cd node-crud-app
Now run below mentioned command to install neccessary dependencies into your project :-
npm install
In order to properly run the system, you have to first configure
.env
file as per the guidelines given inexample.env
or as per your project requirement.Install nodemon as a utility that will monitor for any changes in your source and automatically restart your server. Perfect for development. Install it using below command :-
npm install -g nodemon
In order to start the server to work, you can execute the command which is mentioned below :-
-
Run the app(For development) by
npm run dev
-
Run the app by(For production)
npm start
This would execute the code from ems/bin/www directory
You can run the tests for the Node.js CRUD application using the following command:
npm test
-
-
Display linting for all files
make all
-
Autofix fixable errors for linting for all files
make all_fix
-
Display linting for staged files
make lint
-
Autofix fixable errors for linting in staged files
make lint_fix