Added API version to route and .env port

This commit is contained in:
Florian Sylvain
2023-01-11 10:34:54 +01:00
parent 5c9a0514f4
commit c67ae37f21
+5 -4
View File
@@ -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}`))