Skip to content

Latest commit

 

History

History
53 lines (39 loc) · 1.17 KB

README.md

File metadata and controls

53 lines (39 loc) · 1.17 KB

🍕 jwt-pizza-service

Coverage badge

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.

Deployment

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',
  },
};

Endpoints

You can get the documentation for all endpoints by making the following request.

curl localhost:3000/api/docs

Development notes

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