Create an express route that responds to GET requests at the URL /tweets that responds with the filetweets.html located in the same directory as app.js

Make sure you create the app and listen on port 8080

var express = require('express');
var app = express.createServer();

app.get('/tweets', function(request, response){
    response.sendfile(__dirname + "/tweets.html");
});

app.listen(8080);

 

相关文章:

  • 2021-06-12
  • 2022-12-23
  • 2021-11-15
  • 2021-11-24
  • 2021-10-31
猜你喜欢
  • 2021-06-21
  • 2021-06-27
  • 2022-02-12
  • 2022-01-21
  • 2021-06-14
  • 2021-12-26
  • 2021-08-11
相关资源
相似解决方案