https://github.com/cheesecake87/flask-example-subdir-host-flask
https://github.com/cheesecake87/flask-example-subdir-host-flask
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cheesecake87/flask-example-subdir-host-flask
- Owner: CheeseCake87
- Created: 2024-11-27T10:44:44.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-28T19:47:12.000Z (over 1 year ago)
- Last Synced: 2025-10-09T12:32:14.239Z (8 months ago)
- Language: HTML
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# EXA-Sub-Domain
(EXA, Example)
Contains a working example of using Flask in the context of a domain
subdirectory.
### Setup
Install Docker and Docker Compose.
Add the following to your `hosts` file:
```bash
127.0.0.1 example.go
```
**Linux most common `hosts` file location**
`/etc/hosts`
(open with sudo if needed, edit, then save)
**Windows `hosts` file location**
`c:\Windows\System32\drivers\etc\hosts`
(copy to desktop, edit, then paste back to folder)
### Run
```bash
docker-compose up --build
```
### Info
This example is set up in a way that you will see both the Nginx
logs and Flask logs in the terminal, after running the above command.
A blueprint is used to match the subdirectory that Flask sits under in the
Nginx site config [5050.app.nginx](nginx_sites_enabled/5050.app.nginx).
The root of the `example.go` domain will show the html page in the
`[nginx_html](nginx_html)` folder. The Flask app will be available at `/subdir`
of the domain.