-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
29 lines (26 loc) · 829 Bytes
/
index.js
File metadata and controls
29 lines (26 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import express from 'express'
import { mangasRouter } from './router/mangas.js';
import cors from 'cors'
const app = express()
const PORT = process.env.PORT ?? 1234;
app.use(cors())
app.use('/api/v1',mangasRouter)
app.get('*',(req,res)=>{
res.json({
message: 'route not exist',
initRouter:'/api/v1',
routes: {
indexPage: '/index',
lastRelease:'/lasted',
categories:['/complete','/romance', '/comedy','/drama','/action','/webcomic'],
anyCategory: '/category/:category',
search: '/search',
getMangaInfoById:'/view/:mangaId',
getGenresList:'/info/genres',
getMangaChapterPages:'/reader/:mangaId/:chapterId',
}
})
})
app.listen(PORT,()=>{
console.log('servidor en Linea en el puerto : '+ PORT)
})