-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
28 lines (25 loc) · 851 Bytes
/
index.ts
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
import express from 'express';
import cors from 'cors';
import videoRouter from './routes/videoRouter';
import categoriaRouter from './routes/categoriaRouter';
import userRouter from './routes/userRouter';
import categoriaApiRouter from './routes/categoriaApiRouter';
import videosApiRouter from './routes/videosApiRouter';
const app = express();
app.use(express.json());
app.use(cors(
/* {
origin: "http://www."
Só aceita requisições deste front-end
}
*/
))
app.set('view engine', 'ejs');
app.use('/users', userRouter);
app.use('/videos', videoRouter);
app.use('/categorias', categoriaRouter);
app.use('/categoriasapi', categoriaApiRouter);
app.use('/videosapi', videosApiRouter);
app.use('/', (req, res) => {res.render('home')})
app.listen(3333, () => {
console.log("App rodando em http://localhost:3333/")});