cgi express
v0.1.2
[实验;测试未经良好的测试]执行Express.js应用程序为CGI程序。
- 由于该库的测试不佳,因此请在生产中使用此图书馆。
- 该库可能与一些CGI执行者不兼容。
@types/express是构建必要的#!/usr/bin/env node
const express = require ( 'express' ) ;
const cgiExpress = require ( 'cgi-express' ) ;
const app = express ( ) ;
// initialize 'app' as usual Express.js application here...
// call 'execute' with the default configuration
// (using process.stdout, process.stdin, and process.env)
cgiExpress . execute ( app ) ; function execute(app: express.Application, opts?: Options): Promise<void>执行Express.js应用程序作为CGI程序。此函数使用process.stdin , process.stdout和process.env属性为默认值。
app - express.js应用程序实例opts - 执行的其他选项( Options ) 执行完成后解决的承诺对象
function executeCore(app: express.Application, opts?: Options & Required<Pick<Options, 'stdin' | 'stdout' | 'env'>>): Promise<void>用自定义的stdin/stdout/env数据执行Express.js应用程序作为CGI程序。
app - express.js应用程序实例opts - 执行的其他选项( Options )(stdin/stdout/env无法使用) 执行完成后解决的承诺对象
麻省理工学院许可证