- Node.js 10+
- Redis 5.0+
- Clone the project from github.
git clone ....
cd myproject
npm install
npm update
- In the root this repository you will find a file named
.env.example
- Create a new file by copying and pasting the file and then renaming it to just
.env
- The file
.env
is already ignored, so you never commit your credentials. - Change the values of the file to your environment (development or production)
- Upload the
.env
to your environment server(development or production) - If you use the postman collection to try the endpoints, change value of the variable
server
on your environment to the url of your server, for development mode use http://localhost:3000
Language is automatically detected from Accept-Language
header on the request. So either you send locale manually on the request or your browser will send its default, if Accept-Language
header is not sent then it will use en
locale as default.
npm run dev
You will know server is running by checking the output of the command npm run dev
****************************
* Starting Server
* Port: 3000
* NODE_ENV: development
****************************
Format your code with prettier by typing:
npm run format
Format all your markdown files with remark by typing:
npm run remark
Lint your code with ESLint by typing:
npm run lint
If you need to add more routes to the project just create a new file in /app/routes/
and it will be loaded dynamically.
When you create a new controller, try to also create another folder with validations and helpers. Ex. /countries
, /countries/validators
and /countries/helpers
. An example of this is included in the repository.