在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:koa-modules/morgan开源软件地址:https://github.com/koa-modules/morgan开源编程语言:JavaScript 100.0%开源软件介绍:koa-morgan
Install$ npm install --save koa-morgan Usage=1.x, 100%, working with morgan and koa-v2const fs = require('fs')
const Koa = require('koa')
const morgan = require('koa-morgan')
// create a write stream (in append mode)
const accessLogStream = fs.createWriteStream(__dirname + '/access.log',
{ flags: 'a' })
const app = new Koa()
// setup the logger
app.use(morgan('combined', { stream: accessLogStream }))
app.use((ctx) => {
ctx.body = 'hello, world!'
})
app.listen(2333) =0.x, working with koa-v1var koa = require('koa');
var morgan = require('koa-morgan');
var app = koa();
app.use(morgan.middleware(format, options)); |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论