Open zubin-madon opened 3 years ago
I'm 90% sure that the templates folder isn't getting used at all at this point and we should probably remove the folder entirely (we're not using any templating libraries anyway).
fastapi is set up to use the /src/static/ folder for static files https://github.com/zubin-madon/NFTrees/blob/7f218e144c398a871f52bc9cf617c361f29ef5a3/src/nft_server.py#L11
If you move the JS file to that folder, I think you should then be able to use this for the import:
<script src="/static/contract.js" defer></script>
I think I'm missing the big picture here. What is the purpose of MetaMask in the context of the application as a whole?
Does it need to run client side or should it be on the server side? If client side - it requires a browser plugin in order to work (might be a big "ask" of the user to install)? If server side, can't it use Python instead of JavaScript?
I'm thoroughly confused between the static and templates folder. Now I deleted index.html from TEMPLATES folder and transferred contract.js to static. Soon as I launched FastAPI and accessed http://localhost:8000 from browser, a new index.html was auto created in templates. I am going to try making an html and js file for metamask in VS Code, and make it functioning. After that I will translate to our project. Right now everything is such a mess I'm thoroughly confused.
Discussed in https://github.com/zubin-madon/NFTrees/discussions/22
``