- NGINX Cookbook
- Tim Butler
- 84字
- 2021-07-03 00:04:28
Getting ready
Express is so minimalistic that it doesn't come with any boilerplate code to get you started. There are a number of generators out there which can set up a structure for you, however, I'm going to stick to a simple web page and a WebSocket for testing. Here's my Express file:
var express = require('express'); var app = express(); var expressWs = require('express-ws')(app); app.get('/', function (req, res) { res.send('Nginx demo!!!'); }); app.ws('/echo', function(ws, req) { ws.on('message', function(msg) { ws.send(msg); }); }); app.listen(3000);
推薦閱讀
- OpenStack Cloud Computing Cookbook(Third Edition)
- 自然語言處理實戰:預訓練模型應用及其產品化
- 編程卓越之道(卷3):軟件工程化
- Django Design Patterns and Best Practices
- NumPy Essentials
- 基于免疫進化的算法及應用研究
- C/C++常用算法手冊(第3版)
- Getting Started with Gulp
- Visual FoxPro程序設計習題集及實驗指導(第四版)
- UI設計全書(全彩)
- Red Hat Enterprise Linux Troubleshooting Guide
- Spring技術內幕:深入解析Spring架構與設計原理(第2版)
- 從零開始學Python網絡爬蟲
- 石墨烯改性塑料
- 愛上C語言:C KISS