0.0.4-alpha.38 • Published 4 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
4 years ago
0.0.4-alpha.37
4 years ago
0.0.4-alpha.36
4 years ago
0.0.4-alpha.35
4 years ago
0.0.4-alpha.32
4 years ago
0.0.4-alpha.34
4 years ago
0.0.4-alpha.31
4 years ago
0.0.4-alpha.29
4 years ago
0.0.4-alpha.28
4 years ago
0.0.4-alpha.27
4 years ago
0.0.4-alpha.26
4 years ago
0.0.4-alpha.24
4 years ago
0.0.4-alpha.23
4 years ago
0.0.4-alpha.18
4 years ago
0.0.4-alpha.17
4 years ago
0.0.4-alpha.13
4 years ago
0.0.4-alpha.9
4 years ago
0.0.4-alpha.8
4 years ago
0.0.4-alpha.7
4 years ago
0.0.4-alpha.4
4 years ago
0.0.4-alpha.2
4 years ago
0.0.4-alpha.3
4 years ago
0.0.3-alpha.6
4 years ago
0.0.3-alpha.8
4 years ago
0.0.3-alpha.1
4 years ago
0.0.3-alpha.0
4 years ago
0.0.2
4 years ago