api-client/nuxt.config.js

393 lines
8.7 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 = {
name: "Postwoman",
shortDescription: "A free, fast and beautiful API request builder",
2019-11-28 15:11:52 +00:00
description:
"Web alternative to Postman - Helps you create requests faster, saving precious time on development.",
2020-02-24 18:44:50 +00:00
}
// 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.
let repoName = (process.env.TRAVIS_REPO_SLUG || "").split("/").pop()
2019-11-28 15:11:52 +00:00
export const routerBase =
process.env.DEPLOY_ENV === "GH_PAGES"
2019-11-28 15:11:52 +00:00
? {
router: {
2020-02-24 18:44:50 +00:00
base: `/${repoName}/`,
},
2019-11-28 15:11:52 +00:00
}
: {
router: {
base: "/",
2020-02-24 18:44:50 +00:00
},
}
2019-08-24 03:06:57 +00:00
export default {
mode: "spa",
2019-08-24 03:06:57 +00:00
/*
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-09-25 00:52:25 +00:00
},
render: {
bundleRenderer: {
shouldPreload: (file, type) => {
return ["script", "style", "font"].includes(type)
2020-02-24 18:44:50 +00:00
},
},
},
2019-08-24 03:06:57 +00:00
head: {
title: `${meta.name} \u2022 ${meta.shortDescription}`,
2019-11-28 15:11:52 +00:00
meta: [
{
charset: "utf-8",
2019-09-04 06:49:17 +00:00
},
{
name: "viewport",
2019-11-28 15:11:52 +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 || "",
2019-09-04 06:49:17 +00:00
},
{
name: "keywords",
2019-11-28 15:11:52 +00:00
content:
2020-03-04 06:50:47 +00:00
"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, socketio",
2019-09-04 06:49:17 +00:00
},
{
name: "X-UA-Compatible",
content: "IE=edge, chrome=1",
2019-09-04 06:49:17 +00:00
},
{
itemprop: "name",
2020-02-24 18:44:50 +00:00
content: `${meta.name} \u2022 ${meta.shortDescription}`,
2019-09-04 06:49:17 +00:00
},
{
itemprop: "description",
2020-02-24 18:44:50 +00:00
content: meta.description,
2019-09-04 06:49:17 +00:00
},
{
itemprop: "image",
2020-02-24 18:44:50 +00:00
content: `https://postwoman.io/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",
2020-02-24 18:44:50 +00:00
content: meta.name,
2019-09-04 06:49:17 +00:00
},
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",
2019-09-04 06:49:17 +00:00
},
{
name: "apple-mobile-web-app-status-bar-style",
content: "black-translucent",
2019-09-04 06:49:17 +00:00
},
{
name: "apple-mobile-web-app-title",
2020-02-24 18:44:50 +00:00
content: meta.name,
2019-09-04 06:49:17 +00:00
},
2019-08-24 03:06:57 +00:00
// Windows phone tile icon
2019-09-04 06:49:17 +00:00
{
name: "msapplication-TileImage",
2020-02-24 18:44:50 +00:00
content: `${routerBase.router.base}icons/icon-144x144.png`,
2019-09-04 06:49:17 +00:00
},
{
name: "msapplication-TileColor",
content: "#202124",
2019-09-04 06:49:17 +00:00
},
{
name: "msapplication-tap-highlight",
content: "no",
2019-09-04 06:49:17 +00:00
},
2019-08-24 03:06:57 +00:00
// OpenGraph
2019-09-04 06:49:17 +00:00
{
property: "og:site_name",
2020-02-24 18:44:50 +00:00
content: meta.name,
2019-09-04 06:49:17 +00:00
},
{
property: "og:url",
content: "https://postwoman.io",
2019-09-04 06:49:17 +00:00
},
{
property: "og:type",
content: "website",
2019-09-04 06:49:17 +00:00
},
{
property: "og:title",
2020-02-24 18:44:50 +00:00
content: `${meta.name} \u2022 ${meta.shortDescription}`,
2019-09-04 06:49:17 +00:00
},
{
property: "og:description",
2020-02-24 18:44:50 +00:00
content: meta.description,
2019-09-04 06:49:17 +00:00
},
{
property: "og:image",
2020-02-24 18:44:50 +00:00
content: `https://postwoman.io/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",
content: "summary_large_image",
2019-09-04 06:49:17 +00:00
},
{
name: "twitter:site",
content: "@liyasthomas",
2019-09-04 06:49:17 +00:00
},
{
name: "twitter:creator",
content: "@liyasthomas",
2019-09-04 06:49:17 +00:00
},
{
name: "twitter:url",
content: "https://postwoman.io",
2019-09-04 06:49:17 +00:00
},
{
name: "twitter:title",
2020-02-24 18:44:50 +00:00
content: `${meta.name} \u2022 ${meta.shortDescription}`,
2019-09-04 06:49:17 +00:00
},
{
name: "twitter:description",
2020-02-24 18:44:50 +00:00
content: meta.description,
2019-09-04 06:49:17 +00:00
},
{
name: "twitter:image",
content: "https://postwoman.io/logo.jpg",
2020-02-24 18:44:50 +00:00
},
2019-08-24 03:06:57 +00:00
],
2019-11-28 15:11:52 +00:00
link: [
{
rel: "icon",
type: "image/x-icon",
2020-02-24 18:44:50 +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",
2020-02-24 18:44:50 +00:00
href: `${routerBase.router.base}icons/icon-48x48.png`,
2019-09-04 06:49:17 +00:00
},
{
rel: "apple-touch-icon",
sizes: "72x72",
2020-02-24 18:44:50 +00:00
href: `${routerBase.router.base}icons/icon-72x72.png`,
2019-09-04 06:49:17 +00:00
},
{
rel: "apple-touch-icon",
sizes: "96x96",
2020-02-24 18:44:50 +00:00
href: `${routerBase.router.base}icons/icon-96x96.png`,
2019-09-04 06:49:17 +00:00
},
{
rel: "apple-touch-icon",
sizes: "144x144",
2020-02-24 18:44:50 +00:00
href: `${routerBase.router.base}icons/icon-144x144.png`,
2019-09-04 06:49:17 +00:00
},
{
rel: "apple-touch-icon",
sizes: "192x192",
2020-02-24 18:44:50 +00:00
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)",
2020-03-05 01:18:10 +00:00
continuous: true,
2019-09-04 06:49:17 +00:00
},
2019-10-11 08:53:07 +00:00
/*
** Customize the loading indicator
*/
loadingIndicator: {
name: "pulse",
color: "var(--ac-color)",
background: "var(--bg-color)",
2019-10-11 08:53:07 +00:00
},
2019-08-24 03:06:57 +00:00
/*
2019-09-04 06:49:17 +00:00
** Global CSS
*/
css: ["~/assets/css/styles.scss", "~/assets/css/themes.scss", "~/assets/css/fonts.scss"],
2019-08-24 03:06:57 +00:00
/*
2019-09-04 06:49:17 +00:00
** Plugins to load before mounting the App
*/
2019-11-28 15:11:52 +00:00
plugins: [
{
src: "~/plugins/vuex-persist",
},
{
src: "~/plugins/v-tooltip",
2020-02-24 18:44:50 +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
["@nuxtjs/pwa"],
["@nuxtjs/axios"],
["@nuxtjs/toast"],
["@nuxtjs/google-analytics"],
["@nuxtjs/sitemap"],
2019-11-28 15:11:52 +00:00
[
"@nuxtjs/google-tag-manager",
2019-11-28 15:11:52 +00:00
{
id: process.env.GTM_ID || "GTM-MXWD8NQ",
2020-02-24 18:44:50 +00:00
},
2019-11-28 15:11:52 +00:00
],
["@nuxtjs/robots"],
["nuxt-i18n"],
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
display: "standalone",
2019-10-01 11:43:23 +00:00
theme_color: "#202124",
background_color: "#202124",
2020-02-24 18:44:50 +00:00
start_url: `${routerBase.router.base}`,
2019-09-29 13:21:43 +00:00
},
2019-10-01 11:43:23 +00:00
2019-09-29 13:21:43 +00:00
meta: {
description: meta.shortDescription,
theme_color: "#202124",
2019-09-29 13:21:43 +00:00
},
2019-10-01 11:43:23 +00:00
2019-11-28 15:11:52 +00:00
icons: (sizes => {
2020-02-24 18:44:50 +00:00
let icons = []
2019-09-29 13:21:43 +00:00
for (let size of sizes) {
icons.push({
2019-11-28 15:11:52 +00:00
src: `${routerBase.router.base}icons/icon-${size}x${size}.png`,
type: "image/png",
2020-02-24 18:44:50 +00:00
sizes: `${size}x${size}`,
})
2019-09-29 13:21:43 +00:00
}
2020-02-24 18:44:50 +00:00
return icons
})([48, 72, 96, 144, 192, 512]),
2019-09-29 13:21:43 +00:00
},
2019-09-28 09:33:16 +00:00
toast: {
position: "bottom-center",
duration: 3000,
theme: "bubble",
2020-02-24 18:44:50 +00:00
keepOnHover: true,
2019-09-28 09:33:16 +00:00
},
googleAnalytics: {
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: "",
Allow: "/",
Sitemap: "https://postwoman.io/sitemap.xml",
2019-11-03 06:06:41 +00:00
},
2019-11-27 08:45:11 +00:00
i18n: {
2019-11-28 15:11:52 +00:00
locales: [
{
code: "en",
name: "English",
iso: "en-US",
2020-03-12 02:17:59 +00:00
file: "en-US.json",
2019-11-27 08:45:11 +00:00
},
{
code: "es",
name: "Español",
iso: "es-ES",
2020-03-12 02:17:59 +00:00
file: "es-ES.json",
2019-11-27 15:49:59 +00:00
},
{
code: "fr",
name: "Français",
iso: "fr-FR",
2020-03-12 02:17:59 +00:00
file: "fr-FR.json",
2019-11-27 17:33:02 +00:00
},
{
code: "fa",
name: "Farsi",
iso: "fa-IR",
2020-03-12 02:17:59 +00:00
file: "fa-IR.json",
},
{
code: "pt",
name: "Português Brasileiro",
iso: "pt-BR",
2020-03-12 02:17:59 +00:00
file: "pt-BR.json",
2019-11-28 01:38:31 +00:00
},
{
code: "cn",
name: "简体中文",
iso: "zh-CN",
2020-03-12 02:17:59 +00:00
file: "zh-CN.json",
},
{
code: "id",
name: "Bahasa Indonesia",
iso: "id-ID",
2020-03-12 02:17:59 +00:00
file: "id-ID.json",
},
{
code: "tr",
name: "Türkçe",
iso: "tr-TR",
2020-03-12 02:17:59 +00:00
file: "tr-TR.json",
2019-12-12 22:35:59 +00:00
},
{
code: "de",
name: "Deutsch",
iso: "de-DE",
2020-03-12 02:17:59 +00:00
file: "de-DE.json",
2019-12-13 06:34:59 +00:00
},
{
code: "ja",
name: "日本語",
iso: "ja-JP",
2020-03-12 02:17:59 +00:00
file: "ja-JP.json",
2020-02-24 18:44:50 +00:00
},
2020-02-25 03:21:33 +00:00
{
code: "ko",
name: "한국어",
iso: "ko-KR",
2020-03-12 02:17:59 +00:00
file: "ko-KR.json",
2020-03-04 06:50:47 +00:00
},
2019-11-27 08:45:11 +00:00
],
defaultLocale: "en",
vueI18n: {
fallbackLocale: "en",
},
2019-11-27 08:45:11 +00:00
lazy: true,
langDir: "lang/",
2019-11-27 08:45:11 +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
*/
2020-02-24 18:44:50 +00:00
extend(config, ctx) {},
},
/*
2019-09-04 06:49:17 +00:00
** Generate configuration
*/
generate: {
2020-02-24 18:44:50 +00:00
fallback: true,
},
/*
** Router configuration
*/
2020-02-24 18:44:50 +00:00
...routerBase,
}