임태민

Update app.js

- check the url mapping
const express = require('express');
const bodyParser = require('body-parser');
const session = require('express-session');
const app = express();
app.use(bodyParser.json());
......@@ -16,40 +16,48 @@ app.use(session({
app.get('/', function(req,res){
res.send("Home page");
})
//login
app.put('/login',function(req,res){
res.send("Login page");
})
//logout
app.put('/logout',function(req,res){
res.send("Logout page");
})
//register
app.post('/register',function(req,res){
res.send('register page');
res.send('Register page');
})
//Mapmain
app.get('/Mapmain',function(req,res){
res.send('Mapmain page');
})
//Read post
app.get('/Mapmain/posts/:postId',function(req,res){
var postId = req.params.postId;
res.send("Mapmain post page", postId);
res.send("Mapmain post page " + postId);
})
//Create post
app.post('/Mapmain/posts',function(req,res){
res.send("Mapmain create page");
})
//Update post
app.put('/Mapmain/posts/:postId',function(req,res){
var postId = req.params.postId;
res.send("Mapmain update page");
res.send("Mapmain update page " + postId);
})
//Delete post
app.delete('/Mapmain/posts/:postId',function(req,res){
var postId = req.params.postId;
res.send("Mapmain update page");
res.send("Mapmain delete page " + postId);
})
//Mapmain/category/:_category
//Mapmain/post/:_pk
......
This diff is collapsed. Click to expand it.
{
"name": "mapmory",
"name": "Mapmory",
"version": "1.0.0",
"description": "",
"main": "app.js",
......@@ -12,6 +12,7 @@
"body-parser": "^1.19.0",
"express": "^4.17.1",
"express-session": "^1.17.1",
"mysql": "^2.18.1"
"mysql": "^2.18.1",
"package.json": "^2.0.1"
}
}
......