mirror of
https://github.com/Floriansylvain/CineAllo.git
synced 2026-08-19 11:43:24 +02:00
Added API version to route and .env port
This commit is contained in:
@@ -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}`))
|
||||
Reference in New Issue
Block a user