socket.io+angular.js+express.js做个聊天应用(一)
node,express开发环境等安装如果已经搞好了。
justhacker@justhacker-ThinkPad-Edge-E440:~/projects/nodejs$ express -e chattingnode create : chattingnode create : chattingnode/package.json create : chattingnode/app.js create : chattingnode/public create : chattingnode/public/javascripts create : chattingnode/public/images create : chattingnode/public/stylesheets create : chattingnode/public/stylesheets/style.css create : chattingnode/routes create : chattingnode/routes/index.js create : chattingnode/routes/users.js create : chattingnode/views create : chattingnode/views/index.ejs create : chattingnode/views/error.ejs create : chattingnode/bin create : chattingnode/bin/www install dependencies: $ cd chattingnode && npm install run the app: $ DEBUG=my-application ./bin/www
接着
<pre name="code" class="java">justhacker@justhacker-ThinkPad-Edge-E440:~/projects/nodejs/chattingnode$ cd chattingnode && npm install
debug@0.7.4 node_modules/debug static-favicon@1.0.2 node_modules/static-favicon ejs@0.8.8 node_modules/ejs morgan@1.0.1 node_modules/morgan └── bytes@0.3.0 cookie-parser@1.0.1 node_modules/cookie-parser ├── cookie@0.1.0 └── cookie-signature@1.0.3 body-parser@1.0.2 node_modules/body-parser ├── qs@0.6.6 ├── type-is@1.1.0 (mime@1.2.11) └── raw-body@1.1.6 (bytes@1.0.0) express@4.0.0 node_modules/express ├── methods@0.1.0 ├── utils-merge@1.0.0 ├── merge-descriptors@0.0.2 ├── parseurl@1.0.1 ├── escape-html@1.0.1 ├── cookie-signature@1.0.3 ├── range-parser@1.0.0 ├── qs@0.6.6 ├── buffer-crc32@0.2.1 ├── fresh@0.2.2 ├── cookie@0.1.0 ├── path-to-regexp@0.1.2 ├── type-is@1.0.0 (mime@1.2.11) ├── send@0.2.0 (mime@1.2.11) ├── accepts@1.0.0 (mime@1.2.11, negotiator@0.3.0) └── serve-static@1.0.1 (send@0.1.4)
justhacker@justhacker-ThinkPad-Edge-E440:~/projects/nodejs/chattingnode$ ls app.js bin node_modules package.json public routes views
justhacker@justhacker-ThinkPad-Edge-E440:~/projects/nodejs/chattingnode$ node ./bin/www GET / 200 10ms - 207b GET /stylesheets/style.css 200 6ms - 110b
项目源代码地址:https://github.com/edagarli/chattingnode
可关注。之后会不断更新。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
2015-03-31 转:ShellExecute函数与ShellExecuteEx函数
2015-03-31 Codeforces Round #FF 446A DZY Loves Sequences
2015-03-31 使用和制作patch文件
2015-03-31 车牌识别算法介绍与实践
2015-03-31 MATLAB中导入数据:importdata函数
2015-03-31 【十大思想实验之中的一个】电车难题
2015-03-31 POJ 3380 最大流