A CPSC 471 Project offering a simple Restaurant API system using Njs, Express and MySQL.
- Open up mySQL and run everything in "schema.sql" as a query (this will generate all tables for restaurantdb)
- Run the following queries:
-
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';
-
flush privileges;
- git clone the repository
- run the command 'npm install'
- start the server with 'npm start'
- Access the API by navigating to 'localhost:3000'
- Add necessary SQL logic to {name}.model.js
- Add method to {name}.controller.js for sending and erroring the SQL logic (template)
- Add route to {name}.routes.js so server knows where to call methods when accessed (get, post, put defined)
- Finally add require route to server.js so the new method is included
- Go to server
- Select Data Export
- Select the database and tables to Export
- Tick "Export to self-contained file"
- Start export - creates an sql file in the location