feature: handle multiple configs

This commit is contained in:
Jean-Baptiste Pasquier
2020-12-14 11:24:35 +01:00
parent 7b87f436a0
commit deb3b25520
7 changed files with 169 additions and 116 deletions

101
README.md
View File

@ -71,6 +71,22 @@ Serve, watch files & rebuild on change with this command:
npm run watch
```
### Multiple config.json
You can have as many `config.*.json` as you need.
Watch on a custom config file:
```bash
CONFIG_PATH='config.customName.json' npm run watch
```
Build with a custom config file:
```bash
CONFIG_PATH='config.customName.json' npm run build
```
## Mandatory modules
By default, a Hubl includes only individual chat modules.
@ -86,9 +102,14 @@ On `config.json`:
"clientLogo": "/images/logo.webp",
"authority": "http://localhost:8000/",
"endpoints": {
"skills": "http://server.url/skills/",
"users": "http://server.url/users/",
"uploads": "http://server.url/upload/"
"get": {
"skills": "http://server.url/skills/",
"users": "http://server.url/users/"
},
"post": {
"users": "http://server.url/users/",
"uploads": "http://server.url/upload/"
}
}
}
```
@ -99,9 +120,9 @@ Where:
* `clientLogo` is an URL to an image file
* `xmppWebsocket` is your [Prosody](https://prosody.im/) with [appropriate modules](https://git.startinblox.com/infra/prosody-modules/) configured on.
* `authority` is the OpenID Provider. Usually, if you use `djangoldp-account` it's the same as your djangoldp server.
* `endpoints.users` is the API endpoints for Users on your djangoldp server. (djangoldp-account)
* `endpoints.skills` is the API endpoints for Skills on your djangoldp server. (djangoldp-skill)
* `endpoints.uploads` is the API endpoints for Uploads on your djangoldp server. (djangoldp-upload)
* `endpoints.*.users` is the API endpoints for Users on your djangoldp server. (djangoldp-account)
* `endpoints.*.skills` is the API endpoints for Skills on your djangoldp server. (djangoldp-skill)
* `endpoints.*.uploads` is the API endpoints for Uploads on your djangoldp server. (djangoldp-upload)
### Communities
@ -157,7 +178,12 @@ On `config.json`:
```json
"endpoints": {
"circle": "http://server.url/circles/"
"get": {
"circle": "http://server.url/circles/"
},
"post": {
"circle": "http://server.url/circles/"
},
}
```
@ -171,7 +197,9 @@ On `config.json`:
```json
"endpoints": {
"dashboard": "http://server.url/dashboard/"
"get": {
"dashboard": "http://server.url/dashboard/"
}
}
```
@ -187,9 +215,9 @@ On `config.json`:
```json
"endpoints": {
"joboffers": "http://server.url/job-offers/",
"skills": "http://server.url/skills/",
"uploads": "http://server.url/upload/"
"get": {
"joboffers": "http://server.url/job-offers/"
}
}
```
@ -203,10 +231,12 @@ On `config.json`:
```json
"endpoints": {
"projects": "http://server.url/projects/",
"customers": "http://server.url/customers/",
"businessproviders": "http://server.url/businessproviders/",
"skills": "http://server.url/skills/"
"get": {
"projects": "http://server.url/projects/"
},
"post": {
"projects": "http://server.url/projects/"
}
}
```
@ -219,12 +249,7 @@ On Server: `djangoldp_skill`, `djangoldp_upload` packages
On `config.json`:
```json
"publicDirectory": true,
"endpoints": {
"groups": "http://server.url/groups/",
"skills": "http://server.url/skills/",
"uploads": "http://server.url/upload/"
}
"publicDirectory": true
```
## Optional community modules
@ -241,9 +266,14 @@ On `config.json`:
```json
"endpoints": {
"events":"http://server.url/events/",
"typeevents":"http://server.url/typeevents/",
"uploads": "http://server.url/upload/"
"get": {
"events":"http://server.url/events/",
"typeevents":"http://server.url/typeevents/"
},
"post": {
"events":"http://server.url/events/",
"typeevents":"http://server.url/typeevents/"
}
}
```
@ -259,10 +289,16 @@ On `config.json`:
```json
"endpoints": {
"resources":"http://server.url/resources/",
"resourceskeywords":"http://server.url/keywords/",
"resourcestypes":"http://server.url/types/",
"uploads": "http://server.url/upload/"
"get": {
"resources":"http://server.url/resources/",
"resourceskeywords":"http://server.url/keywords/",
"resourcestypes":"http://server.url/types/"
},
"post": {
"resources":"http://server.url/resources/",
"resourceskeywords":"http://server.url/keywords/",
"resourcestypes":"http://server.url/types/"
}
}
```
@ -276,7 +312,12 @@ On `config.json`:
```json
"endpoints": {
"polls":"http://server.url/polls/"
"get": {
"polls":"http://server.url/polls/"
},
"post": {
"polls":"http://server.url/polls/"
}
}
```
@ -316,4 +357,4 @@ Did you properly created subscriptions on your DjangoLDP's server? You can quick
## Built With
* [Sib-Core](https://git.startinblox.com/framework/sib-core/) - A SOLID-Compliant framework
* [Sib-Core](https://git.startinblox.com/framework/sib-core/) - A SOLID-Compliant framework