标签:res render color pre express4 style put module pos
1 var express = require("express"); 2 var router = express(); 3 4 router.get(‘/‘, function (req, res) { 5 res.render(‘articles‘, {titles: ‘文章页‘, content: ‘这是文章页的内容,method==‘ + req.method}); 6 }) 7 .post(‘/‘, function (req, res) { 8 res.json({msg: "添加文章成功"}) 9 }) 10 .put(‘/‘, function (req, res) { 11 if (req.body.id) { 12 res.json({msg: "文章修改成功"}) 13 } 14 }); 15 16 module.exports = router;
标签:res render color pre express4 style put module pos
原文地址:http://www.cnblogs.com/toward-the-sun/p/6266164.html