/mysql-api

My solutions for BED practical 6 onwards :D

Primary LanguageJavaScript

mysql-api

This will be where I update my solutions for BED Practical 6 onwards :D

File structure:

mysql-api/
┣ src/
┃ ┣ api/
┃ ┃ ┣ controller/
┃ ┃ ┃ ┣ app.js
┃ ┃ ┃ ┗ userController.js
┃ ┃ ┣ middleware/
┃ ┃ ┃ ┣ async.js
┃ ┃ ┃ ┗ errHandler.js
┃ ┃ ┣ model/
┃ ┃ ┃ ┗ user.js
┃ ┃ ┗ routes/
┃ ┃   ┣ friendRouter.js
┃ ┃   ┗ userRouter.js
┃ ┣ config/
┃ ┃ ┣ .env
┃ ┃ ┗ dbConfig.js
┃ ┗ server.js
┣ .gitignore
┣ package.json
┣ README.md
┗ yarn.lock

Checklist

  • Add PUT methods for /user/:userid enpoint to edit/update data
  • Add routes for /friends endpoint
  • Reformat code to use async await

Quick Start

Note: A database has to be created beforehand to use this.

  1. Clone repo:
git clone https://github.com/timothyckl/mysql-api
  1. Install all packages:
yarn install
# or
npm install
  1. Run server.js:
yarn start
# or
npm start