# Sample Dual-Endpoint Web Application (Dashboard + API)

1. [Home](https://www.agilicus.com/)
2. Sample Dual-Endpoint Web Application (Dashboard + API)

![](https://www.agilicus.com/www/98208b64-messaging.svg)Sample

---

## Dual-Endpoint Web Application (Dashboard + API)

A single web application with two unique API endpoints, with appropriate tokens to secure them.

[CONTACT](/contact-us/)

## Overview

See the companion code in [Github](https://github.com/Agilicus/flask-example). This can be run with `docker-compose up` to demonstrate.

In this example, we have an HTML web dashboard (running on localhost:5000), and an API (running pn localhost:5001). We use the Web Application Firewall rewrite to remap the API to a prefix (so it will become conceptually localhost:5000/api). This allows it to be represented as a single-sign-on session, on a single external URL.

In this example, we first create an application. On the 3rd step, "My Application Is An API"... if your API correctly uses [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS), you can leave this as-is. Else consider setting it, or example the 'Define' step later for more configuration.

When you get to step 7 (Configure Upstream Services), enter 1 for each endpoint. The main (HTML) one is 'application', the others are path\_prefix. Substitute the real hostname if you need (you may need additional remapping later if your application is hard-coded).

Once you have completed the New Application Stepper, navigate to the 'Define' screen to refine the setup. On the 'Proxy' Tab, enable 'Rewrite Common Media Types'.

Add permission to your user, and the page should work at https://&lt;name&gt;&lt;domain&gt;/

[![](https://www.agilicus.com/www/9acd6364-p1-1024x613.png)](https://www.agilicus.com/www/9acd6364-p1.png)[![](https://www.agilicus.com/www/81cf0af1-p2-1024x553.png)](https://www.agilicus.com/www/81cf0af1-p2.png)[![](https://www.agilicus.com/www/a8308de4-p3-1024x643.png)](https://www.agilicus.com/www/a8308de4-p3.png)[![](https://www.agilicus.com/www/436f2239-p5-1024x441.png)](https://www.agilicus.com/www/436f2239-p5.png)[![](https://www.agilicus.com/www/c951daae-p6-1024x556.png)](https://www.agilicus.com/www/c951daae-p6.png)[![](https://www.agilicus.com/www/f43ba286-p7-1024x522.png)](https://www.agilicus.com/www/f43ba286-p7.png)[![](https://www.agilicus.com/www/0756aeb8-p8-1024x697.png)](https://www.agilicus.com/www/0756aeb8-p8.png)[![](https://www.agilicus.com/www/b1d1d376-p10-1024x662.png)](https://www.agilicus.com/www/b1d1d376-p10.png)[![](https://www.agilicus.com/www/88c28bec-p11-1024x830.png)](https://www.agilicus.com/www/88c28bec-p11.png)[![](https://www.agilicus.com/www/0441a33e-p12-1024x364.png)](https://www.agilicus.com/www/0441a33e-p12.png)[![](https://www.agilicus.com/www/79e7662c-p13.png)](https://www.agilicus.com/www/79e7662c-p13.png)