Deploy Single API from multiple APIs as a microservice
See original GitHub issueFirst Check
- I added a very descriptive title to this issue.
- I used the GitHub search to find a similar issue and didn’t find it.
- I searched the FastAPI documentation, with the integrated search.
- I already searched in Google “How to X in FastAPI” and didn’t find any information.
- I already read and followed all the tutorial in the docs and didn’t find an answer.
- I already checked if it is not related to FastAPI but to Pydantic.
- I already checked if it is not related to FastAPI but to Swagger UI.
- I already checked if it is not related to FastAPI but to ReDoc.
Commit to Help
- I commit to help with one of those options 👆
Example Code
# segment/main.py
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def read_root():
return {"Hello": "Segment"}
# campaign/main.py
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def read_root():
return {"Hello": "Campaign"}
Description
In below link I saw that we can define routes when we have multiple APIs in Fast API. https://fastapi.tiangolo.com/tutorial/bigger-applications/
Now my question is, How can i deploy single API from whole project. I want to keep logger, exception & utility classes common and don’t want to re-deploy them.
Below if my folder structure. Here in api folder, I want to deploy segment and campaign APIs independently.
I’m new in FastAPI so forgive me in advance if i asked silly question 😄
Operating System
Windows
Operating System Details
No response
FastAPI Version
0.79.0
Python Version
3.8
Additional Context
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Architecting multiple microservices behind a single domain ...
Implement a process to ensure each customer's API Gateway API key is the same across accounts for a smooth customer experience. API Gateway ......
Read more >java - Deploy multiple APIs under one customized domain ...
I am trying to deploy microservices application using amazon web services products.My application wouldn't be really big, ...
Read more >The API gateway pattern versus the direct client-to ...
Understand the differences and the uses of the API gateway pattern and the direct client-to-microservice communication.
Read more >API Microservices bundle multiple services as one ...
So I am going to be developing atleast 5-6 Res end points . ( all distinct and stateless ) Now I am debating...
Read more >How to deploy multiple micro-services under one API domain ...
Learn how to use the same domain name for multiple Serverless services with API Gateway base path mappings.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jayudhandha so you want to deploy
campaign
andsegment
defferently, ie startcampaign
on server-a andsegment
on server-b, right?1, copy code to server-* 2, if you want to start
campaign
just run following:3, if you want to start
segment
just run following:Closing this issue as I’ve used Router for our requirements.
Thanks, Jayesh