This is a simple demo application that implements a CRUD functionality that is related to users(Create users, Read users, Update users and Delete users). The demo shows basic workflow with fb-traffic-resolver
- Backend API running in inner docker network on port 8000
- Resolver running on http://localhost:80 or simply http://localhost (See docker-compose.yml and .env file).
Resolver will give a frontend(static) files on http://localhost:80. But also you can get access to API using the same host. For instance, try HTTP GET http://localhost:80/api/users. So, frontend can simply rely on the path
/api
(See how it's implemented in the demo).
As you can see from Dockerfile, all we have to do is to run API and to move built frontend to the container with resolver (to the root path).
- ADDRESS_OF_API - as the name suggests it is the environment variable that specifies an address of API. In the demo we're using docker-compose, so it's easy to reference to backend API by the container's name that is declared in docker-compose.yml. In kubernetes it can be service's name instead.
- PING_API_ON_START - should resolver ping backend API on start or not. Possible values (True/False)
- RESOLVER_PORT - the port of resolver. In the demo it is port 80
Just execute:
make run
to shut down the demo type:
make down