* app.jsconst Koa = require('koa');const koaBody = require('koa-body');const app = module.exports = new Koa();app.use(koaBody({ jsonLimit: '1kb'}));// POST .name to /uppercase// co-body...
OOP:* Flock.jsfunction Flock(n) { this.seagulls = n;}Flock.prototype.conjoin = function(other) { // console.log(this, 'conjoin', other); this.seagulls += other.seagulls; return this;}...
1. 安装redis库npm install --save redis2. ../../.../config.jsmodule.exports = { // ... redis: { host: "172.16.0.224", port: 6379, options: { password: "m...
* npm installnpm install --save koa-body* index.jsconst koaBody = require('koa-body');koa.use(koaBody({ multipart: true, formidable: { maxFileSize: 100 * 1024 * 1024 // 100M,...
* main.jsconst events = require("events");var process = require("process");var eventEmitter = new events.EventEmitter();eventEmitter.on("connect", function() { console.log("连接成功"); e...
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号