This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const formatApiError = (err) => { | |
if (err.response) { | |
const { status, statusText, data } = err.response | |
if (data.errors) { | |
// API error | |
return { | |
status, | |
statusText, | |
errors: data.errors, | |
message: data.message |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const nuxtConfig = { | |
loadingIndicator: { | |
name: '~/template/spa-loading.html' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const internalIp = require('internal-ip') | |
const express = require('express') | |
const proxy = require('express-http-proxy') | |
const app = express() | |
const https = require('https') | |
const { readFileSync } = require('fs') | |
require('colors') | |
const isLocalIpHosting = process.argv[2] === 'local-ip-hosting' | |
const isHttps = process.argv[2] === 'https' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const Koa = require('koa') | |
const cors = require('@koa/cors') | |
const Router = require('koa-router') | |
const axiosBase = require('axios') | |
require('colors') | |
const axios = axiosBase.create({ | |
baseURL: 'https://xxxxx.xxx/api/v1/', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const Koa = require('koa') | |
const cors = require('@koa/cors') | |
const Router = require('koa-router') | |
const bodyparser = require('koa-bodyparser') | |
require('colors') | |
const app = new Koa() | |
const router = new Router() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"semi": false, | |
"singleQuote": true, | |
"arrowParens": "always" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"global": { | |
"ask_for_confirmation_before_quitting": true, | |
"check_for_updates_on_startup": true, | |
"show_in_menu_bar": true, | |
"show_profile_name_in_menu_bar": false, | |
"unsafe_ui": false | |
}, | |
"profiles": [ | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const glob = require('glob'); | |
const mkdirp = require('mkdirp'); | |
const { readFile, writeFile } = require('fs'); | |
const { promisify } = require('util'); | |
const { dirname, basename } = require('path'); | |
const readFileAsync = promisify(readFile); | |
const writeFileAsync = promisify(writeFile); | |
const globAsync = promisify(glob); | |
const mkdirpAsync = promisify(mkdirp); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const glob = require('glob') | |
const mkdirp = require('mkdirp') | |
const imagemin = require('imagemin') | |
const pngquant = require('imagemin-pngquant') | |
const mozjpeg = require('imagemin-mozjpeg') | |
const gifsicle = require('imagemin-gifsicle') | |
const svgo = require('imagemin-svgo') | |
const { | |
readFile, | |
writeFile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Koa = require('koa') | |
const cors = require('@koa/cors') | |
const axiosBase = require('axios') | |
const axios = axiosBase.create({ | |
baseURL: 'https://virtserver.swaggerhub.com/[USER_ID]/[PROJECT_NAME]/1.0.0', | |
https: true, | |
headers: { | |
Authorization: 'API_TOKEN' | |
}, |