Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adamnasrudin03/rest-api-school
rest api with express js, MySQL, JWT Authication
https://github.com/adamnasrudin03/rest-api-school
Last synced: 13 days ago
JSON representation
rest api with express js, MySQL, JWT Authication
- Host: GitHub
- URL: https://github.com/adamnasrudin03/rest-api-school
- Owner: adamnasrudin03
- Created: 2020-08-20T06:06:50.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-17T10:59:23.000Z (about 4 years ago)
- Last Synced: 2024-10-17T01:59:31.732Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 55.7 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rest-api-school
rest api with express js, MySQL, JWT Authication## Project setup
```
npm installthen set up the database in the dbConfig.js file
```
### Run
install nodemon, then
```
npm run dev
```
Comment the code below, which is located at server.js:
```
database.sequelize.sync().then(() => {
console.log(" re-sync db.");
});
```
then activate the code below, which was previously commented on. located in server.js :
```
// database.sequelize
// .sync({ force: true })
// .then(() => {
// initial();
// console.log("Drop and re-sync db successfully");
// })
// .catch((err) => {
// console.log(err.message);
// });
```
above function to drop database and add user role in database **then save, after the program is run successfully. Return the code as before in server.js**