A simple metric logging using node.js which is a metric logging and reporting service that sums metrics by time window for the most recent hour..
The project uses jest for writing unit tests and nodemon for re-running scripts during development.
For development, you will need Node.js installed in your environement.
Just go on official Node.js website and download the installer.
Also, be sure to have git
available in your path, npm
might need it (You can find git here).
-
You can install nodejs and npm easily with apt install, just run the following commands.
$ sudo apt install nodejs $ sudo apt install npm
-
You can find more information about the installation on the official Node.js website and the official NPM website.
If the installation was successful, you should be able to run the following command.
$ node --version
v14.17.0
$ npm --version
6.14.13
If you need to update npm
, you can make it using npm
, After running the following command.
$ npm install npm -g
Unzip the file simleLogMetrics.zip
Init project:
$ cd simleLogMetrics
$ npm install
$ npm install jest
$ npm install express
$ npm install body-parser
$ npm start
$ npm run test
$ npm run dev