@polarpop/azure-middleware-multipart
Multipart plugin for handling form-data requests in @polarpop/azure-middleware
Installation
If you already have @polarpop/azure-middleware
installed, then you do not need to install it.
npm install --save @polarpop/azure-middleware-multipart @polarpop/azure-middleware
yarn add @polarpop/azure-middleware-multipart @polarpop/azure-middleware
Usage
import { HttpRequest } from '@azure/functions';
import multipart from '@polarpop/azure-middleware-multipart';
import azureMiddleware from '@polarpop/azure-middleware';
const app = azureMiddleware<HttpRequest>();
app.use(multipart());
app.use((context, req) => {
if (context.fields) {
context.res = {
status: 200,
body: {
fields: JSON.stringify(context.fields),
},
};
}
context.done();
});
export default app.listen();