关于express框架的学习
1. 安装
npm init -y
npm install --save express2. hello world
var express=require("express")
var app=express() //init server
app.get("/",function(req,rep){ //request root url
/*rep.send("hello express")*/ //response the client
rep.send("中文 is ok!") //response the client with chinese
})
app.listen(8080,function(){
console.log("The server is running in 8080 port")
})具体使用
代码完成之后服务器自动完成重启的问题
路由操作
配置模板引擎
基于GET请求实现留言板
基于POST请求实现留言板
2.基本的模板
Last updated