-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
33 lines (25 loc) · 757 Bytes
/
app.js
File metadata and controls
33 lines (25 loc) · 757 Bytes
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
const express = require("express");
const cors = require("cors");
const app = express()
const port = 3001; //Frontend is running on 3000
app.use(cors())
app.use(express.json())
app.post('/sitemate/api/create', (req, res) => {
const issue = req.body
console.log(issue)
res.json(issue)
})
app.get('/sitemate/api/read', (req, res) => {
const jiraIssue = { 'ID': 'Bug001', 'Title': 'Sample Title', 'Description': 'Sample description' }
res.json(jiraIssue)
})
app.put('/sitemate/api/Update', (req, res) => {
const issue = req.body
console.log(issue)
})
app.delete('/sitemate/api/delete/:id', (req, res) => {
console.log(req.params.id)
})
app.listen(port, () => {
console.log('Server is up and running on port 3001')
})