You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

28 lines
633 B

import { config, method } from "@noderun/hapi-router";
import UploadFunc from "./_upload";
export default class {
index(request, h) {
return h.view("views/index.ejs");
}
@config({
payload: {
maxBytes: 20000 * 1024 * 1024,
output: "stream",
parse: false,
allow: "multipart/form-data",
},
})
@method("POST")
async upload(req, h) {
const startTime = new Date().getTime();
const res = await UploadFunc(req, h);
const endTime = new Date().getTime();
console.log(
`该请求处理时间为:${Number(endTime - startTime).toFixed(2)}ms`
);
return res;
}
}