1234567891011121314151617181920212223242526 |
- import express from 'express'
- import bodyParser from 'body-parser'
- import bhttp from 'bhttp'
- import swisstennis from './routes/swisstennis'
- import { authenticate, verify } from './routes/authenticate'
- const port = process.env.PORT || 3002
- const app = express()
- app.use(bodyParser.urlencoded({ extended: false }))
- app.use(bodyParser.json())
- app.get('/', (req, res) => {
- res.send(`Express API at http://localhost:${port}/api`)
- })
- const apiRoutes = express.Router()
- apiRoutes.use('/swisstennis', swisstennis)
- app.use('/authenticate', authenticate)
- app.use('/api', verify)
- app.use('/api', apiRoutes)
- app.listen(port)
- console.log(`Server running on port ${port}.`)
|