Skip to content

Instantly share code, notes, and snippets.

@paul-lupu
Last active May 22, 2020 18:51
Show Gist options
  • Save paul-lupu/3904137ce0845fd3dd1a7e4f05ae4a20 to your computer and use it in GitHub Desktop.
Save paul-lupu/3904137ce0845fd3dd1a7e4f05ae4a20 to your computer and use it in GitHub Desktop.
map $sent_http_content_type $expires {
"text/html" epoch;
"text/html; charset=utf-8" epoch;
default off;
}
{
"compilerOptions": {
"baseUrl": "",
"paths": {
"~/*": ["./*"],
"@/*": ["./*"],
"~~/*": ["./*"],
"@@/*": ["./*"]
}
},
"exclude": ["node_modules", ".nuxt", "dist"]
}
server { # the port nginx is listening on
server_name news.citor3.com; # setup your domain here
gzip on;
gzip_types text/plain application/xml text/css application/javascript;
gzip_min_length 1000;
location / {
expires $expires;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 1m;
proxy_connect_timeout 1m;
proxy_pass http://127.0.0.1:3000; # set the address of the Node.js instance here
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/news.citor3.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/news.citor3.com/privkey.pem; # managed by Certbot
10,23 19%
import path from 'path'
import axios from 'axios'
function getGameRoutes() {
return axios.get(
'https://lya5p2yr.api.sanity.io/v1/data/query/production?query=*[_type=="game"]'
)
}
function getNewArticleRoutes() {
return axios.get(
'https://lya5p2yr.api.sanity.io/v1/data/query/production?query=*[_type=="newsArticle"]'
)
}
function getStaticPageRoutes() {
return axios.get(
'https://lya5p2yr.api.sanity.io/v1/data/query/production?query=*[_type=="staticText"]'
)
}
export default {
mode: 'universal',
/*
** Headers of the page
*/
head: {
title: 'CITOR3 Entertainment Studios',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{
hid: 'description',
name: 'description',
content: process.env.npm_package_description || ''
}
],
link: [
{
rel: 'icon',
type: 'image/png',
size: '32x32',
href: '/CITOR3-favicon-32x32px.png'
},
{
rel: 'icon',
type: 'image/png',
size: '16x16',
href: '/CITOR3-favicon-16x16px.png'
}
]
},
generate: {
routes(callback) {
axios
.all([getGameRoutes(), getNewArticleRoutes(), getStaticPageRoutes()])
.then(
axios.spread((games, newsArticles, staticTexts) => {
const gameRoutes = games.data.result.map((game) => {
return '/games/' + game.slug.current
})
const newsRoutes = newsArticles.data.result.map((newsArticle) => {
return '/news/' + newsArticle.slug.current
})
const staticRoutes = staticTexts.data.result.map((staticText) => {
return '/' + staticText.slug.current
})
const routes = [...gameRoutes, ...newsRoutes, ...staticRoutes]
callback(null, routes)
})
)
.catch(callback)
}
},
/*
** Customize the progress-bar color
*/
loading: { color: '#fff' },
/*
** Global CSS
*/
css: ['@/assets/scss/main.scss', '@/assets/css/tailwind.scss'],
/*
** Plugins to load before mounting the App
*/
plugins: [
{ src: '@/plugins/vue-tiny-slider.js', mode: 'client' },
{ src: '@/plugins/vue-gallery.client.js', mode: 'client' }
],
/*
** Nuxt.js dev-modules
*/
buildModules: [
'@nuxtjs/dotenv',
'@nuxtjs/eslint-module',
'@nuxtjs/stylelint-module',
'@nuxtjs/axios',
[
'@nuxtjs/google-analytics',
{
id: 'UA-162019462-1'
}
]
],
/*
** Nuxt.js modules
*/
modules: ['@nuxtjs/apollo', 'cookie-universal-nuxt'],
/*
** Build configuration
*/
build: {
/*
** You can extend webpack config here
*/
extend(config, ctx) {
config.node = {
fs: 'empty'
}
},
postcss: {
plugins: {
tailwindcss: path.resolve(__dirname, './tailwind.config.js')
}
}
},
apollo: {
includeNodeModules: true, // optional, default: false (this includes graphql-tag for node_modules folder)
authenticationType: 'Bearer', // optional, default: 'Bearer'
// optional
errorHandler: '~/plugins/apollo-error-handler.js',
defaultOptions: {
// See 'apollo' definition
$query: {
loadingKey: 'loading',
fetchPolicy: 'cache-and-network'
}
},
// required
clientConfigs: {
default: '~/plugins/apollo-config.js'
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment