const request = require('request-promise');
const requestOptions = {
url: `http://127.0.0.1:8000/hoge`,
method: 'POST',
headers: { "Content-Type": "application/json" },
json: sendParams
}
let response = await request(requestOptions)
// async wrapper
const asyncWrapper = fn => {
return (req, res, next) => {
return fn(req, res, next).catch(next);
}
};
router.get('/auth', asyncWrapper(async(req, res, next) => {
}));
$ npm run dev
Module Warning (from ./node_modules/eslint-loader/dist/cjs.js): errors 20:21:35
/Users/koibuchitetsuya/work/focusup-web/pages/index.vue
10:9 warning Require self-closing on Vue.js custom components (<work>) vue/html-self-closing
✖ 1 problem (0 errors, 1 warning)
0 errors and 1 warning potentially fixable with the `--fix` option.
errors 20:21:35
You may use special comments to disable some warnings. errors 20:21:35
Use // eslint-disable-next-line to ignore the next line. errors 20:21:35
Use /* eslint-disable */ to ignore all warnings in a file. errors 20:21:35
ERROR Failed to compile with 7 errors errors 20:21:35
These dependencies were not found: errors 20:21:35
errors 20:21:35
* fs in ./node_modules/request/lib/har.js errors 20:21:35
* net in ./node_modules/forever-agent/index.js, ./node_modules/request-promise/node_modules/tough-cookie/lib/cookie.js and 2 others
* tls in ./node_modules/forever-agent/index.js, ./node_modules/tunnel-agent/index.js errors 20:21:35
errors 20:21:35
To install them, you can run: npm install --save fs net tls
// Build Configuration (https://go.nuxtjs.dev/config-build)
build: {
extend: function (config, {isDev, isClient}) {
config.node = {
fs: "empty"
};
}
},