From c67ae37f2121d56e0d562f9e4c4eaa1a2d69010b Mon Sep 17 00:00:00 2001 From: Florian Sylvain Date: Wed, 11 Jan 2023 10:34:54 +0100 Subject: [PATCH] Added API version to route and .env port --- app.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index 3515702..ab581b3 100644 --- a/app.js +++ b/app.js @@ -5,15 +5,16 @@ import { showsRouter } from './routes/shows.js' dotenv.config() const app = express() -const port = 3000 +const port = process.env.CINEALLO_PORT app.use(logger('dev')) app.use(express.json()) app.use(express.urlencoded({ extended: false })) -app.get('/', async (req, res, next) => { - res.send({message:"voila ton index"}) +app.get('/v1/', async (req, res, next) => { + res.send({ message: "CineAllo v1.0" }) }) -app.use('/shows', showsRouter) + +app.use('/v1/shows', showsRouter) app.listen(port, () => console.log(`Listening on port ${port}`)) \ No newline at end of file