- 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);
推薦閱讀
- TypeScript Essentials
- The DevOps 2.3 Toolkit
- 動手玩轉Scratch3.0編程:人工智能科創教育指南
- Web Development with Django Cookbook
- DevOps Automation Cookbook
- HTML5+CSS3+JavaScript Web開發案例教程(在線實訓版)
- Advanced Oracle PL/SQL Developer's Guide(Second Edition)
- Hands-On Automation Testing with Java for Beginners
- Node.js 12實戰
- SQL Server 2008 R2數據庫技術及應用(第3版)
- Arduino可穿戴設備開發
- 黑莓(BlackBerry)開發從入門到精通
- Learning Image Processing with OpenCV
- Python第三方庫開發應用實戰
- Java設計模式深入研究