Backend service for making JWT pizzas. This service tracks users and franchises and orders pizzas. All order requests are passed to the JWT Pizza Factory where the pizzas are made.
JWTs are used for authentication objects.
In order for the server to work correctly it must be configured by providing a config.js
file.
export default {
jwtSecret: 'your-cryptographically-generated-secret-here',
db: {
connection: {
host: 'localhost',
user: 'root',
password: 'your-secure-database-password-here',
database: 'pizza',
connectTimeout: 60000,
},
listPerPage: 10,
},
factory: {
url: 'https://pizza-factory.cs329.click',
apiKey: 'your-factory-issued-api-key-here',
},
};
You can get the documentation for all endpoints by making the following request.
curl localhost:3000/api/docs
Install the required packages.
npm install express jsonwebtoken mysql2 bcrypt
Nodemon is assumed to be installed globally so that you can have hot reloading when debugging.
npm -g install nodemon