Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const express = require('express')
- var path = require('path');
- const app = express()
- const port = 8080;
- app.listen(port, () => console.log(`Example app listening on port ${port}!`))
- // get no file
- // app.get('/', (req, res) => res.send('Hello World Bitch!'))
- app.get('/', function (req, res) {
- res.sendFile(path.join(__dirname + '/index.html'));
- });
- app.get('/test-get', function (req, res) {
- res.send('Hello World TestGet!')
- })
- app.post('/test-post', function (req, res) {
- res.send('Hello World TestPost!')
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement