config.js.example -> config.json.example (ref. #31)

merge-requests/23/head
Michał 'rysiek' Woźniak 2022-01-22 15:20:49 +00:00
rodzic 9d6186e7f3
commit 07693eeedd
2 zmienionych plików z 23 dodań i 40 usunięć

Wyświetl plik

@ -1,40 +0,0 @@
/*
* LibResilient config
*
* This is an example config for LibResilient. When deploying LibResilient on your website
* you will need to create your own config, using this one as a template.
*
*/
// plugins config
self.LibResilientConfig.plugins = [{
name: 'fetch'
},{
name: 'cache'
},{
name: 'any-of',
uses: [{
name: 'alt-fetch',
// configuring the alternate endpoints plugin to use IPNS gateways
//
// NOTICE: we cannot use CIDv0 with gateways that use hash directly in the (sub)domain:
// https://github.com/node-fetch/node-fetch/issues/260
// we *can* use CIDv1 with such gateways, and that's suggested:
// https://docs.ipfs.io/how-to/address-ipfs-on-web/#path-gateway
// https://cid.ipfs.io/
endpoints: [
'https://<CIDv1>.ipns.dweb.link/', // USA
'https://ipfs.kxv.io/ipns/<CIDv0-or-CIDv1>/', // Hong Kong
'https://jorropo.net/ipns/<CIDv0-or-CIDv1>/', // France
'https://gateway.pinata.cloud/ipns/<CIDv0-or-CIDv1>/', // Germany
'https://<CIDv1>.ipns.bluelight.link/' // Singapore
]
},{
name: 'gun-ipfs',
gunPubkey: '<your-gun-pubkey>'
}]
}]
// we need to explicitly list components we want to see debug messages from
self.LibResilientConfig.loggedComponents = ['service-worker', 'fetch', 'cache', 'any-of', 'alt-fetch', 'gun-ipfs']

Wyświetl plik

@ -0,0 +1,23 @@
{
"plugins": [{
"name": "fetch"
},{
"name": "cache"
},{
"name": "any-of",
"uses": [{
"name": "alt-fetch",
"endpoints": [
"https://<CIDv1>.ipns.dweb.link/",
"https://ipfs.kxv.io/ipns/<CIDv0-or-CIDv1>/",
"https://jorropo.net/ipns/<CIDv0-or-CIDv1>/",
"https://gateway.pinata.cloud/ipns/<CIDv0-or-CIDv1>/",
"https://<CIDv1>.ipns.bluelight.link/"
]
},{
"name": "gun-ipfs",
"gunPubkey": "<your-gun-pubkey>"
}]
}],
"loggedComponents": ["service-worker", "fetch", "cache", "any-of", "alt-fetch", "gun-ipfs"]
}