update: simplify config

This commit is contained in:
Clément
2018-12-17 15:20:36 +01:00
parent b840c2fdb6
commit d3c3d6d921
9 changed files with 58 additions and 23 deletions

View File

@ -1,4 +0,0 @@
- var sdn = process.env.SDN || 'https://test-paris.happy-dev.fr'
- var cdn = process.env.CDN || 'staging-app.happy-dev.fr'
- var xmpp = 'https://jabber.happy-dev.fr/http-bind/'
- var client_id = 833925

15
src/config.json Normal file
View File

@ -0,0 +1,15 @@
{
"dev": {
"sdn": "http://127.0.0.1:8000",
"cdn": "https://cdn.happy-dev.fr",
"xmpp": "https://jabber.happy-dev.fr/http-bind/",
"client_id": "833925"
},
"prod": {
"sdn": "https://test-paris.happy-dev.fr",
"cdn": "https://cdn.happy-dev.fr",
"xmpp": "https://jabber.happy-dev.fr/http-bind/",
"client_id": "833925"
}
}

View File

@ -1,4 +0,0 @@
- var sdn = process.env.SDN || 'http://127.0.0.1:8000'
- var cdn = process.env.CDN || 'staging-app.happy-dev.fr'
- var xmpp = 'https://jabber.happy-dev.fr/http-bind/'
- var client_id = 863031

15
src/config.sample.json Normal file
View File

@ -0,0 +1,15 @@
{
"dev": {
"sdn": "http://127.0.0.1:8000",
"cdn": "https://cdn.happy-dev.fr",
"xmpp": "https://jabber.happy-dev.fr/http-bind/",
"client_id": "833925"
},
"prod": {
"sdn": "https://test-paris.happy-dev.fr",
"cdn": "https://cdn.happy-dev.fr",
"xmpp": "https://jabber.happy-dev.fr/http-bind/",
"client_id": "833925"
}
}

View File

@ -1,4 +0,0 @@
- var sdn = process.env.SDN || 'http://127.0.0.1:8000'
- var cdn = process.env.CDN || 'https://cdn.happy-dev.fr'
- var xmpp = 'https://jabber.happy-dev.fr/http-bind/'
- var client_id = '833925'

6
src/get_config.pug Normal file
View File

@ -0,0 +1,6 @@
- var __env = locals[process.env.ENV]
-
for(k in __env){
eval(`var ${k} = __env[${JSON.stringify(k)}]`);
}

View File

@ -1,4 +1,4 @@
include config.pug
include get_config.pug
<!DOCTYPE html>
html(lang="en")
head