Compare commits

..

No commits in common. "cb8b2cc5aa7bae5b7d4007acc5df5a555eaebe6d" and "5a572915235523a1549f23e467bdc0f924f5f1d5" have entirely different histories.

3 changed files with 17 additions and 10 deletions

View File

@ -1,16 +1,14 @@
FROM node:18
FROM 'node:18'
RUN mkdir -p /usr/src/app/server/
WORKDIR /usr/src/app/
COPY ./server /usr/src/app/server
COPY ./package.json /usr/src/app/package.json
COPY ./package-lock.json /usr/src/app/package-lock.json
COPY ./.serverrc.js /usr/src/app/.serverrc.js
# COPY ./.env /usr/src/app/.env
# RUN npm i --omit=dev
RUN npm ci
RUN npm i --only=prod
EXPOSE 8044
CMD ["npm", "run", "up:prod"]

View File

@ -1,15 +1,15 @@
const router = require('express').Router();
router.get('/recipe-data', (request, response) => {
response.send(require('./json/recipe-data/success.json'));
});
response.send(require('../json/recipe-data/success.json'))
})
router.get('/userpage-data', (req, res)=>{
res.send(require('./json/userpage-data/success.json'));
});
res.send(require('../json/userpage-data/success.json'))
})
router.get('/homepage-data', (req, res)=>{
res.send(require('./json/homepage-data/success.json'));
});
res.send(require('../json/homepage-data/success.json'))
})
module.exports = router;

View File

@ -4,6 +4,15 @@ router.get('/landing-data', (request, response) => {
response.send(require('./json/landing-data/success.json'));
});
router.post('/login', (req, response) => {
const { username, password } = req.body;
if (username === 'admin') {
response.send(require('./json/user/sitter.success.json'));
} else {
response.send(require('./json/landing-data/success.json'));
}
});
router.post('/search', (req, res) => {
const { search } = req.body;