nuxt.config.js 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. require("dotenv").config()
  2. // Some helpful application constants.
  3. // TODO: Use these when rendering the pages (rather than just for head/meta tags...)
  4. export const options = {
  5. name: "Postwoman",
  6. shortDescription: "A free, fast and beautiful API request builder",
  7. description:
  8. "Web alternative to Postman - Helps you create requests faster, saving precious time on development.",
  9. loading: {
  10. color: "#202124",
  11. },
  12. }
  13. // Sets the base path for the router.
  14. // Important for deploying to GitHub pages.
  15. // -- Travis includes the author in the repo slug,
  16. // so if there's a /, we need to get everything after it.
  17. let repoName = (process.env.TRAVIS_REPO_SLUG || "").split("/").pop()
  18. export const routerBase =
  19. process.env.DEPLOY_ENV === "GH_PAGES"
  20. ? {
  21. router: {
  22. base: `/${repoName}/`,
  23. },
  24. }
  25. : {
  26. router: {
  27. base: "/",
  28. },
  29. }
  30. export default {
  31. mode: "spa",
  32. /*
  33. ** Headers of the page
  34. */
  35. server: {
  36. host: "0.0.0.0", // default: localhost
  37. },
  38. head: {
  39. title: `${options.name} • ${options.shortDescription}`,
  40. meta: [
  41. {
  42. name: "keywords",
  43. content:
  44. "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",
  45. },
  46. {
  47. name: "X-UA-Compatible",
  48. content: "IE=edge, chrome=1",
  49. },
  50. {
  51. itemprop: "name",
  52. content: `${options.name} • ${options.shortDescription}`,
  53. },
  54. {
  55. itemprop: "description",
  56. content: options.description,
  57. },
  58. {
  59. itemprop: "image",
  60. content: `https://postwoman.io/logo.jpg`,
  61. },
  62. {
  63. property: "og:image",
  64. content: `https://postwoman.io/logo.jpg`,
  65. },
  66. // Add to homescreen for Chrome on Android. Fallback for PWA (handled by nuxt)
  67. {
  68. name: "application-name",
  69. content: options.name,
  70. },
  71. // Windows phone tile icon
  72. {
  73. name: "msapplication-TileImage",
  74. content: `${routerBase.router.base}icons/icon-144x144.png`,
  75. },
  76. {
  77. name: "msapplication-TileColor",
  78. content: "#202124",
  79. },
  80. {
  81. name: "msapplication-tap-highlight",
  82. content: "no",
  83. },
  84. ],
  85. link: [
  86. {
  87. rel: "icon",
  88. type: "image/x-icon",
  89. href: `${routerBase.router.base}favicon.ico`,
  90. },
  91. // Home-screen icons (iOS)
  92. {
  93. rel: "apple-touch-icon",
  94. href: `${routerBase.router.base}icons/icon-48x48.png`,
  95. },
  96. {
  97. rel: "apple-touch-icon",
  98. sizes: "72x72",
  99. href: `${routerBase.router.base}icons/icon-72x72.png`,
  100. },
  101. {
  102. rel: "apple-touch-icon",
  103. sizes: "96x96",
  104. href: `${routerBase.router.base}icons/icon-96x96.png`,
  105. },
  106. {
  107. rel: "apple-touch-icon",
  108. sizes: "144x144",
  109. href: `${routerBase.router.base}icons/icon-144x144.png`,
  110. },
  111. {
  112. rel: "apple-touch-icon",
  113. sizes: "192x192",
  114. href: `${routerBase.router.base}icons/icon-192x192.png`,
  115. },
  116. ],
  117. },
  118. /*
  119. ** Customize the progress-bar color
  120. */
  121. loading: {
  122. color: "var(--ac-color)",
  123. continuous: true,
  124. },
  125. /*
  126. ** Customize the loading indicator
  127. */
  128. loadingIndicator: {
  129. name: "pulse",
  130. color: "var(--ac-color)",
  131. background: "#202124",
  132. },
  133. /*
  134. ** Global CSS
  135. */
  136. css: ["~/assets/css/styles.scss", "~/assets/css/themes.scss", "~/assets/css/fonts.scss"],
  137. /*
  138. ** Plugins to load before mounting the App
  139. */
  140. plugins: [
  141. {
  142. src: "~/plugins/vuex-persist",
  143. },
  144. {
  145. src: "~/plugins/v-tooltip",
  146. },
  147. ],
  148. /*
  149. ** Nuxt.js dev-modules
  150. */
  151. buildModules: [
  152. // See https://goo.gl/OOhYW5
  153. "@nuxtjs/pwa",
  154. // Doc: https://github.com/nuxt-community/dotenv-module
  155. "@nuxtjs/dotenv",
  156. // Doc: https://github.com/nuxt-community/analytics-module
  157. "@nuxtjs/google-analytics",
  158. // Doc: https://github.com/nuxt-community/gtm-module
  159. "@nuxtjs/gtm",
  160. ],
  161. /*
  162. ** Nuxt.js modules
  163. */
  164. modules: [
  165. // Doc: https://axios.nuxtjs.org/usage
  166. "@nuxtjs/axios",
  167. // https://github.com/nuxt-community/modules/tree/master/packages/toast
  168. "@nuxtjs/toast",
  169. // Doc: https://github.com/nuxt-community/nuxt-i18n
  170. "nuxt-i18n",
  171. // Doc: https://github.com/nuxt-community/sitemap-module
  172. "@nuxtjs/sitemap",
  173. // Doc: https://github.com/nuxt-community/robots-module
  174. "@nuxtjs/robots",
  175. ],
  176. pwa: {
  177. manifest: {
  178. name: options.name,
  179. short_name: options.name,
  180. start_url: `${routerBase.router.base}`,
  181. display: "standalone",
  182. background_color: "#202124",
  183. description: options.shortDescription,
  184. theme_color: "#202124",
  185. },
  186. meta: {
  187. ogHost: "https://postwoman.io",
  188. twitterCard: "summary_large_image",
  189. twitterSite: "@liyasthomas",
  190. twitterCreator: "@liyasthomas",
  191. description: options.shortDescription,
  192. theme_color: "#202124",
  193. },
  194. },
  195. toast: {
  196. position: "bottom-center",
  197. duration: 3000,
  198. theme: "bubble",
  199. keepOnHover: true,
  200. },
  201. googleAnalytics: {
  202. id: process.env.GA_ID || "UA-61422507-2",
  203. },
  204. gtm: {
  205. id: process.env.GTM_ID || "GTM-MXWD8NQ",
  206. },
  207. sitemap: {
  208. hostname: "https://postwoman.io",
  209. },
  210. robots: {
  211. UserAgent: "*",
  212. Disallow: "",
  213. Allow: "/",
  214. Sitemap: "https://postwoman.io/sitemap.xml",
  215. },
  216. env: {
  217. API_KEY: process.env.API_KEY,
  218. AUTH_DOMAIN: process.env.AUTH_DOMAIN,
  219. DATABASE_URL: process.env.DATABASE_URL,
  220. PROJECT_ID: process.env.PROJECT_ID,
  221. STORAGE_BUCKET: process.env.STORAGE_BUCKET,
  222. MESSAGING_SENDER_ID: process.env.MESSAGING_SENDER_ID,
  223. APP_ID: process.env.APP_ID,
  224. MEASUREMENT_ID: process.env.MEASUREMENT_ID,
  225. },
  226. i18n: {
  227. locales: [
  228. {
  229. code: "en",
  230. name: "English",
  231. iso: "en-US",
  232. file: "en-US.json",
  233. },
  234. {
  235. code: "es",
  236. name: "Español",
  237. iso: "es-ES",
  238. file: "es-ES.json",
  239. },
  240. {
  241. code: "fr",
  242. name: "Français",
  243. iso: "fr-FR",
  244. file: "fr-FR.json",
  245. },
  246. {
  247. code: "fa",
  248. name: "Farsi",
  249. iso: "fa-IR",
  250. file: "fa-IR.json",
  251. },
  252. {
  253. code: "pt",
  254. name: "Português",
  255. iso: "pt-PT",
  256. file: "pt-PT.json",
  257. },
  258. {
  259. code: "pt-br",
  260. name: "Português Brasileiro",
  261. iso: "pt-BR",
  262. file: "pt-BR.json",
  263. },
  264. {
  265. code: "cn",
  266. name: "简体中文",
  267. iso: "zh-CN",
  268. file: "zh-CN.json",
  269. },
  270. {
  271. code: "tw",
  272. name: "繁體中文",
  273. iso: "zh-TW",
  274. file: "zh-TW.json",
  275. },
  276. {
  277. code: "id",
  278. name: "Bahasa Indonesia",
  279. iso: "id-ID",
  280. file: "id-ID.json",
  281. },
  282. {
  283. code: "tr",
  284. name: "Türkçe",
  285. iso: "tr-TR",
  286. file: "tr-TR.json",
  287. },
  288. {
  289. code: "de",
  290. name: "Deutsch",
  291. iso: "de-DE",
  292. file: "de-DE.json",
  293. },
  294. {
  295. code: "ja",
  296. name: "日本語",
  297. iso: "ja-JP",
  298. file: "ja-JP.json",
  299. },
  300. {
  301. code: "ko",
  302. name: "한국어",
  303. iso: "ko-KR",
  304. file: "ko-KR.json",
  305. },
  306. ],
  307. defaultLocale: "en",
  308. vueI18n: {
  309. fallbackLocale: "en",
  310. },
  311. lazy: true,
  312. langDir: "lang/",
  313. },
  314. /*
  315. ** Build configuration
  316. */
  317. build: {
  318. /*
  319. ** You can extend webpack config here
  320. */
  321. extend(config, ctx) {
  322. config.node = {
  323. fs: "empty",
  324. }
  325. },
  326. },
  327. /*
  328. ** Generate configuration
  329. */
  330. generate: {
  331. fallback: true,
  332. },
  333. /*
  334. ** Router configuration
  335. */
  336. ...routerBase,
  337. }