api-client/nuxt.config.js

300 lines
6.9 KiB
JavaScript
Raw Normal View History

2019-08-24 03:06:57 +00:00
// Some helpful application constants.
// TODO: Use these when rendering the pages (rather than just for head/meta tags...)
2019-08-24 17:01:57 +00:00
export const meta = {
2019-08-24 03:06:57 +00:00
name: "Postwoman",
shortDescription: "API request builder",
2019-08-24 03:06:57 +00:00
description: "The Postwoman API request builder helps you create your requests faster, saving you precious time on your development."
};
// Sets the base path for the router.
// Important for deploying to GitHub pages.
// -- Travis includes the author in the repo slug,
// so if there's a /, we need to get everything after it.
2019-08-24 17:01:57 +00:00
let repoName = (process.env.TRAVIS_REPO_SLUG || '').split('/').pop();
export const routerBase = process.env.DEPLOY_ENV === 'GH_PAGES' ? {
router: {
2019-09-04 08:41:55 +00:00
base: `/${repoName}/`
}
2019-08-24 17:01:57 +00:00
} : {
router: {
base: '/'
}
};
2019-08-24 03:06:57 +00:00
export default {
mode: 'spa',
/*
2019-09-04 06:49:17 +00:00
** Headers of the page
*/
2019-09-25 00:52:25 +00:00
server: {
host: '0.0.0.0', // default: localhost
},
2019-08-24 03:06:57 +00:00
head: {
title: `${meta.name} \u2022 ${meta.shortDescription}`,
2019-11-02 05:32:21 +00:00
meta: [{
2019-09-04 06:49:17 +00:00
charset: 'utf-8'
},
{
name: 'viewport',
2019-11-11 13:31:49 +00:00
content: 'width=device-width, initial-scale=1, minimum-scale=1, viewport-fit=cover, minimal-ui'
2019-09-04 06:49:17 +00:00
},
{
hid: 'description',
name: 'description',
content: meta.description || ''
},
{
name: 'keywords',
content: 'postwoman, postwoman chrome, postwoman online, postwoman for mac, postwoman app, postwoman for windows, postwoman google chrome, postwoman chrome app, get postwoman, postwoman web, postwoman android, postwoman app for chrome, postwoman mobile app, postwoman web app, api, request, testing, tool, rest, websocket, sse, graphql'
2019-09-04 06:49:17 +00:00
},
{
name: 'X-UA-Compatible',
content: "IE=edge, chrome=1"
},
{
itemprop: "name",
content: `${meta.name} \u2022 ${meta.shortDescription}`
},
{
itemprop: "description",
content: meta.description
},
{
itemprop: "image",
2019-11-11 13:53:35 +00:00
content: `${routerBase.router.base}logo.jpg`
2019-09-04 06:49:17 +00:00
},
2019-08-24 03:06:57 +00:00
// Add to homescreen for Chrome on Android. Fallback for PWA (handled by nuxt)
2019-09-04 06:49:17 +00:00
{
name: 'application-name',
content: meta.name
},
2019-08-24 03:06:57 +00:00
// Add to homescreen for Safari on iOS
2019-09-04 06:49:17 +00:00
{
name: 'apple-mobile-web-app-capable',
content: 'yes'
},
{
name: 'apple-mobile-web-app-status-bar-style',
content: 'black-translucent'
},
{
name: 'apple-mobile-web-app-title',
content: meta.name
},
2019-08-24 03:06:57 +00:00
// Windows phone tile icon
2019-09-04 06:49:17 +00:00
{
name: 'msapplication-TileImage',
content: `${routerBase.router.base}icons/icon-144x144.png`
},
{
name: 'msapplication-TileColor',
2019-09-20 13:11:35 +00:00
content: '#252628'
2019-09-04 06:49:17 +00:00
},
{
name: 'msapplication-tap-highlight',
content: 'no'
},
2019-08-24 03:06:57 +00:00
// OpenGraph
2019-09-04 06:49:17 +00:00
{
property: 'og:site_name',
content: meta.name
},
{
property: 'og:url',
2019-09-05 14:59:16 +00:00
content: 'https://postwoman.io'
2019-09-04 06:49:17 +00:00
},
{
property: 'og:type',
content: 'website'
},
{
property: 'og:title',
content: `${meta.name} \u2022 ${meta.shortDescription}`
},
{
property: 'og:description',
content: meta.description
},
{
property: 'og:image',
2019-11-11 13:53:35 +00:00
content: `${routerBase.router.base}logo.jpg`
2019-09-04 06:49:17 +00:00
},
2019-08-24 03:06:57 +00:00
// Twitter
2019-09-04 06:49:17 +00:00
{
name: 'twitter:card',
2019-11-11 13:53:35 +00:00
content: "summary_large_image"
2019-09-04 06:49:17 +00:00
},
{
name: 'twitter:site',
content: "@liyasthomas"
},
{
name: 'twitter:creator',
content: "@liyasthomas"
},
{
name: 'twitter:url',
2019-09-05 14:59:16 +00:00
content: "https://postwoman.io"
2019-09-04 06:49:17 +00:00
},
{
name: 'twitter:title',
2019-11-11 13:31:49 +00:00
content: `${meta.name} \u2022 ${meta.shortDescription}`
2019-09-04 06:49:17 +00:00
},
{
name: 'twitter:description',
2019-11-11 13:31:49 +00:00
content: meta.description
2019-09-04 06:49:17 +00:00
},
{
name: 'twitter:image',
2019-11-11 13:53:35 +00:00
content: `${routerBase.router.base}logo.jpg`
2019-09-04 06:49:17 +00:00
},
2019-08-24 03:06:57 +00:00
],
2019-11-02 05:32:21 +00:00
link: [{
2019-09-04 06:49:17 +00:00
rel: 'icon',
type: 'image/x-icon',
2019-09-05 09:02:24 +00:00
href: `${routerBase.router.base}favicon.ico`
2019-09-04 06:49:17 +00:00
},
2019-08-24 03:06:57 +00:00
// Home-screen icons (iOS)
2019-09-04 06:49:17 +00:00
{
rel: 'apple-touch-icon',
href: `${routerBase.router.base}icons/icon-48x48.png`
},
{
rel: 'apple-touch-icon',
sizes: '72x72',
href: `${routerBase.router.base}icons/icon-72x72.png`
},
{
rel: 'apple-touch-icon',
sizes: '96x96',
href: `${routerBase.router.base}icons/icon-96x96.png`
},
{
rel: 'apple-touch-icon',
sizes: '144x144',
href: `${routerBase.router.base}icons/icon-144x144.png`
},
{
rel: 'apple-touch-icon',
sizes: '192x192',
href: `${routerBase.router.base}icons/icon-192x192.png`
},
2019-08-24 03:06:57 +00:00
]
},
/*
2019-09-04 06:49:17 +00:00
** Customize the progress-bar color
*/
loading: {
color: 'var(--ac-color)'
},
2019-10-11 08:53:07 +00:00
/*
** Customize the loading indicator
*/
loadingIndicator: {
name: 'pulse',
color: 'var(--ac-color)',
background: 'var(--bg-color)'
},
2019-08-24 03:06:57 +00:00
/*
2019-09-04 06:49:17 +00:00
** Global CSS
*/
2019-08-24 03:06:57 +00:00
css: [
'@/assets/css/themes.scss',
2019-08-24 03:06:57 +00:00
'@/assets/css/fonts.scss',
'@/assets/css/styles.scss'
],
/*
2019-09-04 06:49:17 +00:00
** Plugins to load before mounting the App
*/
2019-11-02 05:32:21 +00:00
plugins: [{
2019-09-04 06:49:17 +00:00
src: '~/plugins/vuex-persist'
},
{
src: '~/plugins/v-tooltip'
2019-09-04 06:49:17 +00:00
}
2019-08-24 03:06:57 +00:00
],
/*
2019-09-04 06:49:17 +00:00
** Nuxt.js dev-modules
*/
2019-11-02 05:32:21 +00:00
buildModules: [],
2019-08-24 03:06:57 +00:00
/*
2019-09-04 06:49:17 +00:00
** Nuxt.js modules
*/
2019-08-24 03:06:57 +00:00
modules: [
// See https://goo.gl/OOhYW5
2019-09-29 13:21:43 +00:00
['@nuxtjs/pwa'],
['@nuxtjs/axios'],
2019-09-28 09:33:16 +00:00
['@nuxtjs/toast'],
2019-10-02 04:54:33 +00:00
['@nuxtjs/google-analytics'],
2019-10-02 10:47:29 +00:00
['@nuxtjs/sitemap'],
2019-11-02 05:32:21 +00:00
['@nuxtjs/google-tag-manager', {
id: process.env.GTM_ID || 'GTM-MXWD8NQ'
2019-11-03 06:06:41 +00:00
}],
['@nuxtjs/robots']
2019-08-24 03:06:57 +00:00
],
2019-09-29 13:21:43 +00:00
pwa: {
manifest: {
name: meta.name,
short_name: meta.name,
2019-10-01 11:43:23 +00:00
2019-09-29 13:21:43 +00:00
display: "standalone",
2019-10-01 11:43:23 +00:00
2019-09-29 15:52:39 +00:00
theme_color: "#252628",
2019-09-29 13:21:43 +00:00
background_color: "#252628",
start_url: `${routerBase.router.base}`
},
2019-10-01 11:43:23 +00:00
2019-09-29 13:21:43 +00:00
meta: {
description: meta.shortDescription,
theme_color: "#252628",
},
2019-10-01 11:43:23 +00:00
2019-09-29 13:21:43 +00:00
icons: ((sizes) => {
let icons = [];
for (let size of sizes) {
icons.push({
"src": `${routerBase.router.base}icons/icon-${size}x${size}.png`,
"type": "image/png",
"sizes": `${size}x${size}`
});
}
return icons;
})([48, 72, 96, 144, 192, 512])
},
2019-09-28 09:33:16 +00:00
toast: {
position: 'bottom-center',
duration: 3000,
theme: 'bubble',
keepOnHover: true
2019-09-28 09:33:16 +00:00
},
googleAnalytics: {
2019-10-02 04:40:19 +00:00
id: process.env.GA_ID || 'UA-61422507-2'
2019-09-28 09:33:16 +00:00
},
sitemap: {
hostname: 'https://postwoman.io'
},
2019-11-03 06:06:41 +00:00
robots: {
UserAgent: '*',
Disallow: '',
2019-11-03 06:17:59 +00:00
Allow: '/',
2019-11-03 06:45:56 +00:00
Sitemap: 'https://postwoman.io/sitemap.xml'
2019-11-03 06:06:41 +00:00
},
2019-08-24 03:06:57 +00:00
/*
2019-09-04 06:49:17 +00:00
** Build configuration
*/
2019-08-24 03:06:57 +00:00
build: {
/*
2019-09-04 06:49:17 +00:00
** You can extend webpack config here
*/
extend(config, ctx) {}
},
/*
2019-09-04 06:49:17 +00:00
** Generate configuration
*/
generate: {
fallback: true
},
/*
** Router configuration
*/
...routerBase
2019-08-24 03:06:57 +00:00
}