diff --git a/.gitignore b/.gitignore index ad46b308..b51cd191 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,6 @@ typings/ # next.js build output .next + + +.idea \ No newline at end of file diff --git a/routes/searchByMenuItem.js b/routes/searchByMenuItem.js index 88de4952..cf2c326f 100644 --- a/routes/searchByMenuItem.js +++ b/routes/searchByMenuItem.js @@ -3,8 +3,8 @@ const router = express(); router.use(express.json()); -const Menu = require('../models/menu'); -const MenuItems = require('../models/menuItems'); +const Menu = require('../models/menu.js'); +const MenuItems = require('../models/menuItems.js'); //const Sequelize = require('sequelize'); //const Op = Sequelize.Op; @@ -34,9 +34,10 @@ router.get('/', async (req, res) => { */ router.get('/', (req, res) => { - console.log('hello world'); + console.log(req.parameters.menuItemName); res.status(200).send('almost there'); }) + module.exports = router; diff --git a/server.js b/server.js index dae31c76..fcfbbaaf 100644 --- a/server.js +++ b/server.js @@ -34,7 +34,7 @@ app.use('/api/user/login', login); app.use('/api/user/customer/register', registrationCustomer); app.use('/api/user/owner/register', registrationOwner); app.use('/api/image',image); -app.use('/api​/user​/customer​/searchByMenuItem', searchByMenuItem); +app.use('/api/user/customer/menu/searchByMenuItem', searchByMenuItem); //Test DB @@ -50,14 +50,17 @@ app.use(bodyParser.json()); const path = require("path"); - app.use(express.static(path.join(__dirname, "thespoon", "build"))); - +/* app.get("*", (req, res) => { res.sendFile(path.join(__dirname, "thespoon", "build", "index.html")); + }); +*/ + + //END OF THE REQUIRED CODE TO MAKE THE DEPLOY WORK const port = process.env.PORT || 5000;