- Create a database
- Update ./knexfile.js with your connection details & database name
- Install packages
npm install
- Create a .env and fill in the following credentials PORT= DB_HOST= DB_DATABASE= DB_USERNAME= DB_PASSWORD= JWT_SECRET_KEY=
- Create a database with the same name as in .env's DB_DATABASE
- Run migrations
npm run migrate
- Run seeds
npm run seed
- Start server
npm run dev
- Generate a secret key and add to .env's JWT_SECRET_KEY: node -e "console.log(require('crypto').randomBytes(64).toString('hex'));"
POST /users/signup
Body: { email name password }
Response: { message: "Successfully signed up" }
POST /users/login
Body: { email password }
Response: { message: "Successfully logged in" token }
GET /pdf
Request Headers:
{
Authorization: Bearer {token}
}
POST /pdf
Body:
//file in formData format
Response: { message: success }