简体   繁体   中英

app.get('/try', function (req, res) not working

i am new to node and express. this is my code :

var express = require('express'); 
var app = express();  
app.get('/', function (req, res)
{ res.send(' { “Hello”: “World” }'); }); 
app.get('/about', function (req, res){ 
 res.send(' { “Hello”: “World” }'); });    
app.listen(3000);  

this works but when i try

app.get('/try', function (req, res){
res.send(' { “Hello”: “World” }');
}); 

the browser give me this message: Cannot GET /try

I am not sure what I am doing wrong

this is express 4 version

重新启动Express服务器解决了该问题

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM