app.js 에 추가한 후 url: 127.0.0.1:3000/topic으로 접근해보자.


============================================================

app.js 

++ 붙여넣기


app.get('/topic',function(req, res){

var topics =[

'javascript is the client language'

,'nodejs is the server side javascript'

,'express is a module of extra modules'

];

var output = `

<a href = "/topic?id=0">Java Script</a><br/>

<a href = "/topic?id=1">Node js</a><br/>

<a href = "/topic?id=2">Express</a><br/>

${topics[req.query.id]}

`;

res.send(output);

});

========================================================

127.0.0.1:3000/topic 으로 접근

Java Script 클릭

Node js 클릭



Express 클릭




+ Recent posts