This is a blank startup project for Node.js using JWT authentication token.
Once the repository cloned, you should remove the .git file created in order not to fork this repository and start your own one.
- Start by cloning this repo
git clone
- Remove the .git file
rm -rf .git
- Install the dependencies
npm install
- Generate your private key for the token generation
node -e "console.log(require('crypto').randomBytes(256).toString('base64'));"
and then add it to theconfig/security/credentials.json
file:
{
"jwt": {
"key": "your-generated-private-key"
}
}
- Run the nodemon server with the command
npm start
In the config/database
folder create a file named credentials.json
and add within it your database specific configuration:
{
"dev": {
"database": "my_db",
"user": "my_user",
"pass": "my_password",
"dialect": "postgres",
"host": "localhost",
"port": 5432
},
"prod": {
}
}
This code is available at github project under MIT licence.