-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
36 lines (30 loc) · 1.32 KB
/
app.js
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
30
31
32
33
34
35
36
'use strict';
const express = require('express')
const app = express()
const path = require('path')
const bodyParser = require('body-parser')
const PORT = 3001
app.use(express.static(path.join(process.cwd(), 'public')))
app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json())
// midleware
const setHeaders = require('./server/midleware/setHeaders')
const webToParse = require('./server/midleware/webToParse')
// Routes
const newsData = require('./server/routes/newsData/')
const laVanguardia = require('./server/routes/laVanguardia/')
const elPais = require('./server/routes/elPais/')
const omicrono = require('./server/routes/omicrono/')
const elAndroideLibre = require('./server/routes/elAndroideLibre/')
const genbeta = require('./server/routes/genbeta/')
const gizmodo = require('./server/routes/gizmodo/')
//app.use('/', setHeaders, firstRoute);
app.use('/api/newsData', setHeaders, newsData)
app.use('/api/lavanguardia', setHeaders, webToParse, laVanguardia)
app.use('/api/elpais', setHeaders, webToParse, elPais)
app.use('/api/omicrono', setHeaders, webToParse, omicrono)
app.use('/api/elandroidelibre', setHeaders, webToParse, elAndroideLibre)
app.use('/api/genbeta', setHeaders, webToParse, genbeta)
app.use('/api/gizmodo', setHeaders, webToParse, gizmodo)
app.listen(PORT)
console.log(`Listening at port ${PORT}`)