The is a configuration file under config/config.json
with the following structure
{
"debug": true,
"zimbraUrl": "http://zimbra.zboxapp.dev:8000/service/admin/soap",
"zimbraProxy": "https://zimbra.zboxapp.dev:7071",
"dnsApiUrl": "http://zimbra.zboxapp.dev:3000",
"plans": {
"basic": true,
"premium": true,
"professional": true,
"default": false
},
"companiesEndPoints": {
"list": "http://zimbra.zboxapp.dev:8001/list",
"detail": "http://zimbra.zboxapp.dev:8001/company/{id}",
"invoices": "http://zimbra.zboxapp.dev:8001/company/{id}/invoices"
}
}
- debug: Use in development environmet to recieve messages in the javascript console.
- zimbraUrl: The URL where the zimbra admin services are running.
- zimbraProxy: The URL of a proxy server to allow CORS between the webapp and the Zimbra admin service. (Only needed in development environment for the server)
- dnsApiUrl: URL of the DNS api to get DNS information ( zDNS ).
- plans: Object with the available mailboxes plans, set to true if enabled or false to disable it.
- companiesEndPoints: This are the enpoints to get information about companies and invoices. (Checkout the companies endpoint specifications below).
- list: The Endpoint to get a list of available companies
- detail: The Endpoint to get information from a specific company. The {id} string paramenter is mandatory.
- invoices: The Endpoint to get information for the invoices of a specific company. The {id} string paramenter is mandatory.
The method of every endpoint should be GET
(so far no security is being allowed).
REST Service that returns a list of available companies.
- Content-Type:
application/json
- Method:
GET
Response should be a json array
with the following structure:
[
{
"id": "company-identifier",
"name": "company name"
}
]
REST Service that returns the company specified by the {id} parameter.
- Content-Type:
application/json
- Method:
GET
Response should be a json object
with the following structure:
{
"id": "company-identifier",
"name": "company name"
}
REST Services that returns the invoices for the company specified by the {id} parameter.
- Content-Type:
application/json
- Method:
GET
Response should be a json array
with the following structure:
[
{
"number": 123,
"link": "optional url to view the invoice",
"date": "2016-04-30T19:33:00Z",
"total": "$ 12.000",
"status": 0
}
]
Posible status are:
Status | Meaning |
---|---|
0 | Pendiente |
1 | Pagada |
2 | Vencida |
3 | Anulada |
You'll need to build the sources ready for production by running
$ make build
This will generate a folder called dist
which holds all the necessary files for deploying the website.
This files have to be copied to your server running NGINX
.
Copy the files to NGINX
html folder and you're done.
A sample for the NGINX
configuration can be found here.
- Add security to the companies Endpoints
- test