0.0.4-alpha.38 • Published 3 years ago
@serverless-devs/http-response-parser v0.0.4-alpha.38
http-response-parser 转化
- html:
content-type
为text/html; charset=utf8
- css:
content-type
为text/css; charset=utf8
- js:
content-type
为text/javascript; charset=utf8
- text:
content-type
为text/plain; charset=utf8
- json:
content-type
为application/json; charset=utf8
- xml:
content-type
为application/xml; charset=utf8
基本用法
'use strict';
const dk = require('@serverless-devs/dk-core');
const httpResponseParser = require('@serverless-devs/http-response-parser');
const handler = dkrequest) => {
return {
html: `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
text/html
</body>
</html>`,
};
});
handler.use(httpResponseParser());
module.exports = { handler };
0.0.4-alpha.38
3 years ago
0.0.4-alpha.37
3 years ago
0.0.4-alpha.36
3 years ago
0.0.4-alpha.35
3 years ago
0.0.4-alpha.32
3 years ago
0.0.4-alpha.34
3 years ago
0.0.4-alpha.31
3 years ago
0.0.4-alpha.29
3 years ago
0.0.4-alpha.28
3 years ago
0.0.4-alpha.27
3 years ago
0.0.4-alpha.26
3 years ago
0.0.4-alpha.24
3 years ago
0.0.4-alpha.23
3 years ago
0.0.4-alpha.18
3 years ago
0.0.4-alpha.17
3 years ago
0.0.4-alpha.13
3 years ago
0.0.4-alpha.9
3 years ago
0.0.4-alpha.8
3 years ago
0.0.4-alpha.7
3 years ago
0.0.4-alpha.4
3 years ago
0.0.4-alpha.2
3 years ago
0.0.4-alpha.3
3 years ago
0.0.3-alpha.6
3 years ago
0.0.3-alpha.8
3 years ago
0.0.3-alpha.1
3 years ago
0.0.3-alpha.0
3 years ago
0.0.2
3 years ago