rorodata / firefly

function as a service
http://rorodata.github.io/firefly
Apache License 2.0
194 stars 30 forks source link

EXPERIMENTAL FEATURE: API Overview Page #72

Open palnabarun opened 6 years ago

palnabarun commented 6 years ago

Currently, the firefly application serves a json docs page at '/`.

The motive is to beautify that data in the form of HTML pages and add features such as trying out the API endpoint from the page itself.

TODO

[x] Add a basic for POC [x] Deciding on a path to host the the page. Currently, it is at /index.html to prevent any conflicts \docs is finalized --- Milestone 1 --- [ ] Add support to firefly to accept an API name parameter through firefly.yml [ ] Finalizing an API template according to optimal UX --- Milestone 2 --- [ ] Add testing features --- Milestone 3 ---

More feature suggestions are welcome.

Attached

Preliminary UI for page image

anandology commented 6 years ago

Looks like we are using more and more of features of flask. I guess it is wise to start using flask rather than wasting our efforts reinventing each of those features.

palnabarun commented 6 years ago

But do we need a full fledged web framework? We might just be using the templating feature of Flask which Jinja is very well providing us with.

anandology commented 6 years ago

Already re-invented context globals, Jinja now and routing tomorrow.

Also I don't think your usage of jinja template is very effective. Creating FileSystemLoader everytime you need a template is expensive. Ideally, the template should be compiled on the first use and reused for subsequent calls. Flask takes care of it automatically.

palnabarun commented 6 years ago

Okay. The loader can be instantiated once.

So what do you suggest? Modifying most things in firefly to use Flask? As routing is most probably the next feature that will be implemented.