This file contains 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
import { cacheAdapterEnhancer } from 'axios-extensions' | |
import LRUCache from 'lru-cache' | |
const ONE_HOUR = 1000 * 60 * 60 | |
const defaultCache = new LRUCache({ maxAge: ONE_HOUR }) | |
export default function ({ $axios }) { | |
const defaults = $axios.defaults | |
// https://github.com/kuitos/axios-extensions | |
defaults.adapter = cacheAdapterEnhancer(defaults.adapter, { |
This file contains 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
import Vuex from "vuex"; | |
import Config from "~/assets/config.js"; | |
let arr = []; | |
let count = 0; | |
const createStore = () => { | |
return new Vuex.Store({ | |
... | |
actions: { | |
async nuxtServerInit ({ commit }, { app }) { |
This file contains 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
import Vuex from "vuex"; | |
import axios from "axios"; | |
import Config from "~/assets/config.js"; | |
const api = axios.create(); | |
let arr = []; | |
let count = 0; | |
/** | |
* This is the secret sauce. | |
* If the data being requested is cached, subsequent API calls will not be made | |
* During a nuxt generate, nuxtServerInit will be called for every page |
This file contains 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
Import-Module -Name D:\Temp\ACME-posh\ACMEPowerShell.psd1 | |
$domain = "mydomain.com" | |
$certificiatePassword = "abcd1234" | |
$email = "[email protected]" | |
$vault = "D:\Vault\{0}\{1}" -f $domain, [guid]::NewGuid() | |
mkdir $vault | |
cd $vault | |
Initialize-ACMEVault -BaseURI https://acme-v01.api.letsencrypt.org/ | |
New-ACMERegistration -Contacts mailto:$email |