- 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);
推薦閱讀
- LabVIEW 2018 虛擬儀器程序設(shè)計(jì)
- 造個(gè)小程序:與微信一起干件正經(jīng)事兒
- Mastering Ember.js
- Practical Internet of Things Security
- SQL基礎(chǔ)教程(視頻教學(xué)版)
- Elasticsearch Server(Third Edition)
- Learning ArcGIS for Desktop
- Haskell Data Analysis Cookbook
- C++從入門到精通(第5版)
- Oracle GoldenGate 12c Implementer's Guide
- 代碼閱讀
- 計(jì)算機(jī)組裝與維護(hù)(第二版)
- PHP項(xiàng)目開發(fā)全程實(shí)錄(第4版)
- Swift High Performance
- C語言進(jìn)階:重點(diǎn)、難點(diǎn)與疑點(diǎn)解析