Home > database >  Approach to Migrate from twisted to fastapi Framework
Approach to Migrate from twisted to fastapi Framework

Time:04-05

I had a requirement of migrating twisted to FastApi.

The old code was completely written in Python 2.7 and used JsonPrc along with twisted client.

Like - [https://stackoverflow.com/a/4738563][1]

Even the static content like html,css,js files used jsonprc to access the API calls. Like there is a complete index.html file which has dependency on html,css, js with jsonprc calls.

I have gone through some documents but couldn't come to conclusion.

Below were few links-

https://github.com/smagafurov/fastapi-jsonrpc

https://github.com/authorizon/fastapi_websocket_rpc

In these I cant see how to integrate html,css,js with jsonrpc. for eg., index.html

So I just want to know the approach to achieve my requirement.

Like websocket, jsonrpc or jinja Template ? Thanks

CodePudding user response:

Is your main issue to serve static files? FastApi has an easy dedicated solution for that: https://fastapi.tiangolo.com/tutorial/static-files/

  • Related