From 59b48cbf770a876bc82b8965504658db3a688099 Mon Sep 17 00:00:00 2001 From: gungunfebrianza Date: Wed, 18 Aug 2021 06:13:41 +0700 Subject: [PATCH] fix minot --- Example-1/{controller => controllers}/tutorial.controller.js | 0 Example-1/server.js | 4 +++- 2 files changed, 3 insertions(+), 1 deletion(-) rename Example-1/{controller => controllers}/tutorial.controller.js (100%) diff --git a/Example-1/controller/tutorial.controller.js b/Example-1/controllers/tutorial.controller.js similarity index 100% rename from Example-1/controller/tutorial.controller.js rename to Example-1/controllers/tutorial.controller.js diff --git a/Example-1/server.js b/Example-1/server.js index fd348af..2bdd6e5 100644 --- a/Example-1/server.js +++ b/Example-1/server.js @@ -3,7 +3,7 @@ const cors = require("cors"); const app = express(); -const db = require("./app/models"); +const db = require("./models/index"); // db.sequelize.sync(); db.sequelize.sync({ force: true }).then(() => { console.log("Drop and re-sync db."); @@ -26,6 +26,8 @@ app.get("/", (req, res) => { res.json({ message: "Hello World!" }); }); +require("./routes/tutorial.routes")(app); + // set port, listen for requests const PORT = process.env.PORT || 8080; app.listen(PORT, () => {