MCPcopy
hub / github.com/node-formidable/formidable / createServer

Function createServer

test/unit/custom-plugins.test.js:10–20  ·  view source on GitHub ↗
(options, handler)

Source from the content-addressed store, hash-verified

8import { formidable, json, octetstream, multipart, errors } from '../../src/index.js';
9
10function createServer(options, handler) {
11 const app = new Koa();
12
13 app.use(async (ctx, next) => {
14 const form = formidable(options);
15 await handler(ctx, form);
16 await next();
17 });
18
19 return app;
20}
21
22function fromFixtures(...args) {
23 return join(process.cwd(), 'test', 'fixture', ...args);

Calls 2

formidableFunction · 0.90
useMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…