forked from AshbyGunter/jest-and-express-practice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
35 lines (27 loc) · 896 Bytes
/
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
const express = require('express');
const app = express();
const port = 3000;
app.use(express.static('public'));
app.get('/', (req, res) => {
console.log('GET "/" request received');
res.status(200).send('yes, got your GET request');
});
app.post('/', (req, res) => {
console.log('POST "/" request received');
res.status(200).send('yes, got your POST request');
});
app.put('/', (req, res) => {
console.log('PUT "/" request received');
res.status(200).send('yes, got your PUT request');
});
app.options('/', (req, res) => {
console.log('OPTIONS "/" request received');
res.status(200).send('yes, got your OPTIONS request');
});
app.delete('/', (req, res) => {
console.log('DELETE "/" request received');
res.status(200).send('yes, got your DELETE request');
});
app.listen(port, () => {
console.log('bare bones acknowledgement server is listening on port 3000');
});