Newer
Older
Backend for citizen participation chatbot. Designed to work with the webplugin
**Current version**
- npm (v6.4.0) https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
- nodejs(v8.11.2) https://nodejs.org/en/
After cloning, go to the root folder from the terminal and run :
Run the following command from the terminal to start the server,
```
npm start
```
When the server runs successfully , it will display
```
Server started on port 3999
```
since we are using websocket the url used to connect to the server should look like that [ws://localhost:3999](ws://localhost:3999)
There are many ways to deploy a nodejs app, but for the sake of simplicity we will use a package called [forever](https://www.npmjs.com/package/forever).
[forever](https://www.npmjs.com/package/forever) is a simple CLI tool for ensuring that a given script runs continuously,
Run the following command from the terminal to start the [forever](https://www.npmjs.com/package/forever) mode, check forever documentation for more advanced usage [here](https://www.npmjs.com/package/forever).
```
npm run start:forever
```
Add this command to the Cron jobs in linux or windows scheduler to run the server on restart.
* [NodeJS](https://nodejs.org/en/) - The javascript framework used
* [Typescript](https://www.typescriptlang.org/) - For easier OOP javascript