Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bishwas-py/lofor
Forward your backend to localhost
https://github.com/bishwas-py/lofor
Last synced: about 1 month ago
JSON representation
Forward your backend to localhost
- Host: GitHub
- URL: https://github.com/bishwas-py/lofor
- Owner: Bishwas-py
- Created: 2023-12-18T09:00:47.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-30T11:23:51.000Z (8 months ago)
- Last Synced: 2024-05-30T13:00:38.329Z (8 months ago)
- Language: Python
- Size: 47.9 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Lofor - A reverse proxy for development
Lofor is a lightweight development server which acts as reverse proxy to solve your cors header problems.
CORS is a common problem faced when developing frontend and backend separated projects.
During development, you may like to use a backend in `localhost:7777/api/` and
frontend in `localhost:7777`.This becomes more complex when you use two different frameworks for backend and frontend.
## How lofor solves the problem?
In lofor, you can map multiple hosts to single one.
### Installation
```bash
pip install lofor
```### Forward command
```bash
lofor forward / http://localhost:5173 # Mapping to svelte dev server
lofor forward /api/ https://localhost:8000 # Mapping to django's dev server# More examples
lofor forward api.localhost /api/ https://localhost:8000
lofor forward localhost http://localhost:3000# You can also map to any real server
# lofor forward / https://example.com
```### Start lofor server
The server will be listening at [http://localhost:7777](http://localhost:7777)
```bash
lofor start
```### To list lofor forwards
```bash
lofor list
```### Remove lofor forwards
```bash
lofor remove /api/
```