[Node.js]24. Level 5: Express, Express routes
2023-09-14 09:00:56 时间
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);
相关文章
- Node.js进程管理之子进程
- Node.js压缩与解压数据
- 【技术贴】解决前台js传参中文乱码
- 2015.10.11(js判断鼠标进入容器的方向)
- [Node.js] Set the Node.js Project to ECMAScript Modules (ESM)
- [Node.js] Mock an API for Local Development in React with Mirage JS
- [Node.js] Web Scraping Images with Node, Xray, and Download
- [Node.js] Level 1 new. Intro the Node.js
- [State Machine] Zag-js
- Node.js 命令行程序开发教程
- 华为OD机试 - 最小调整顺序次数、特异性双端队列(Java & JS & Python)
- 编写第一个node.js实例
- Chrome浏览器,搜索JS方法。
- js- float类型相减 出现无限小数的问题
- log4js-node:node.js日志框架输出到文件
- 笔记:Node.js 的 Buffer 缓冲区
- js 在div光标位置加入内容