Adding your API - File System
Last updated
Was this helpful?
Last updated
Was this helpful?
By choosing a File System based configuration we have a static way of configure Janus (similar to nginx).
We highly recommend you to use one of our examples to start. Let's see the example:
Make sure you have docker up and running on your platform and then run.
This will spin up a janus server and will have a small proxy configuration that is going to a mock server that we spun up.
Issue the following cURL request to verify that Janus is properly forwarding requests to your API. Note that [by default][proxy-port] Janus handles proxy requests on port :8080
:
If you access http://localhost:8080/example
you should something like:
A successful response means Janus is now forwarding requests made to http://localhost:8080
to the elected upstream target (chosen by the load balancer) we configured in step #1, and is forwarding the response back to us.
By default all apis configurations are splitted in separated files (both single and multiple api definitions per file are supported) and they are stored in /etc/janus
. You can change that path by simply defining the configuration database.dsn
, for instance, you can define the value to file:///usr/local/janus
.
There are two required folder that needs to be there:
/etc/janus/apis
- Holds all API definitions
/etc/janus/auth
- Holds all your Auth servers configurations
To add a new endpoint or authentication you can see the but instead of using the admin API you'll add your configuration to a file and reload the docker instance: