A simple checklist application using nodeJS to create the package.json
- initialisation od the project to create the
package.json
:
npm init
- install our dependencies (
--save
will save the package todependencies
inpackage.json
, replace it by--save-dev
to save them indevDependencies
inpackage.json
):
- install EJS (Embedded JavaScript templating): used to be able to write Javascript code with the HTML files
npm install ejs --save
- install
body-parser
that will be used to parse the http request
npm install body-parser --save
- install mongoose to connect to our databse
npm install mongoose --save
-
Use mlab to create your noSql database and get your connection string to be able to connect to it using
mongoose
.
Before running the app you need to create a user in the MongoDB (mlab) database and put the credentials in config.json
also change the connection string in index.js file.
- Development:
nodemon app.js
- Otherwise
node app.js
- Run the docker engine:
sudo systemctl start docker
- build the docker image for the application:
sudo docker build .
check if the image exists:
sudo docker images
or
sudo docker image ls
- Run the image