Commit 11edfbe4 authored by root's avatar root
Browse files

Initial json API commit

parents
const express = require('express');
var bodyParser = require("body-parser");
const app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}));
app.post("/login", (req, res) => {
console.log("body: ", req.body);
res.send('Hello from API');
})
app.get("/detail", (req, res) => {
res.send('DEEEEETAIL');
})
app.listen(3001, () => console.log('App available on http://localhost/3001'));
This diff is collapsed.
{
"name": "ex02",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon index.js"
},
"dependencies": {
"express": "^4.17.2",
"body-parser": "^1.19.2",
"vue": "^3.2.31",
"vue-router": "^4.0.12"
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment