10475720
我写的两个文件一个是index.js,另一个是hello.html,,我想要测试一下express,通过res.redirect来跳转到hello.html。 index.js内容如下:
var express = require('express');
var app = express();
app.get('/', function (req, res) {
//res.redirect('hello');
res.redirect('./hello');
});
app.get('hello',function(req,res){
res.end('asdf');
});
app.listen(3000);
console.log("http://localhost:3000");
可是运行后总是报错说,,cannot get ./hello 是我哪个语法写错了么。还是什么写错了呢