line_push/.nuxt/dist/server/pages/autofill.js
2022-07-21 07:52:14 +00:00

35 lines
910 B
JavaScript

exports.ids = [2];
exports.modules = {
/***/ 86:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* WEBPACK VAR INJECTION */(function(URL) {const ENDPOINT = 'https://api.contree.io/profile';
/* harmony default export */ __webpack_exports__["default"] = ({
async middleware({
req,
res,
error,
$axios,
redirect
}) {
const url = new URL(req.url, `https://${req.headers.host}`);
const uid = url.searchParams.get('LINEUserID') || '';
const response = await $axios.get(ENDPOINT, {
params: {
LINEUserID: uid
}
});
await res.setHeader('Content-Type', 'application/json; charset=utf-8');
res.end(JSON.stringify(response.data.slice(-1)));
}
});
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(50)["URL"]))
/***/ })
};;
//# sourceMappingURL=autofill.js.map