tornadoweb / tornadoweb/tornado

Serve multiple Applications from a single HTTPServer

Open
#2,830 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

docs routing
Dominant language
Python
Stars
22.2k
Forks
5.6k
Avg merge
3h 42m
Merged PRs (30d)
16

Description

I would like to serve a variety of applications from a single HTTPServer.

Normally, I would just take the various handler dictionaries and merge them somehow. However, one of my applications is a Bokeh server application, which has its own custom subclass of tornado.web.Application, and I'd rather not try to unpack the logic that that custom subclass does.

In my ideal world I would either ...

  1. List all of the applications, and hope that their routes do not intersect

    server = web.HTTPServer([app1, app2])
    
  2. Key each application with a prefix

    server = web.HTTPServer({"/app1": app1, "/app2": app2})
    

Is there some way to do something similar today?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the HTTPServer entry point and the custom tornado.web.Application behavior described in the issue. Investigate how multiple applications or prefixed applications could coexist without unpacking application-specific routing logic. Done means a supported, tested way to serve several applications from one HTTPServer, including the proposed list or prefix-based use cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.