Page MenuHomeSoftware Heritage

storage API server: nicer landing page
Closed, MigratedEdits Locked

Description

Running a local storage server invites the (developer) user to visit the HTTP landing page:

* Running on http://localhost:5002/ (Press CTRL+C to quit)

visiting that page works in the browser, which shows a bare bone "SWH Storage API server" message, but fails with a 404 werkzeug traceback on the console.

We should make the landing page nicer by, e.g., showing a browsable REST API documentation of the storage API server.

Event Timeline

zack triaged this task as Low priority.Sep 14 2018, 4:26 PM
zack created this task.

The RPC client/server components have been made as trivial as possible and considering their presence in the critical path of everything we do, I think we should keep them that way. They're not meant to conform to REST or any other standards, and are not supposed to support browsing.

However I'd be happy for the static default landing pages to tell people that, and to point to the (static) API documentation of the respective components.

In T1194#22202, @olasd wrote:

However I'd be happy for the static default landing pages to tell people that, and to point to the (static) API documentation of the respective components.

Sounds good to me. In this case something like "You've reached the Software Heritage storage server. See its documentation and API for more information."

Also, it shouldn't return 404. And I'm not clear on why it currently does so, given the werkzeug route exists:

@app.route('/')
def index():
    return 'SWH Storage API server'

This is now done.

JFTR, I was misreading the debug output about the 404. It was about favicon.ico.
GET / properly returns a 200 answer, as it should.