Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require('dotenv').config()
- const express = require('express')
- const bodyParser = require('body-parser')
- const cors = require('cors')
- const app = express()
- app.use(cors())
- app.use(bodyParser.json())
- app.use(express.static('public'))
- app.get('/', (req, res) => {
- const query = req.query
- console.log('query:', query)
- res.sendFile(__dirname + '/public/lorem.html')
- })
- const listener = app.listen(process.env.PORT || 5000, () => {
- console.log('Your app is listening on port ' + listener.address().port)
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement