News for hackers. Stuff that matters.
Re:Don't build a general-purpose API to power your own front... by tdeck on Tuesday September 14, 2021 @12:53AM (#28520374)
Also, consider using Rails and Turbolinks if you're familiar with them. You can get pretty far with turbolinks and the responsiveness is similar to a single page app.
Re:Don't build a general-purpose API to power your own front... by andreygrehov on Tuesday September 14, 2021 @12:58AM (#28520402)
Thanks for the advice. I use Go on the backend, but couldn't resist some "fanciness". I embed all the html/css/js/images files into a binary and serve everything from memory. Zero disc reads. It's blazing fast. Also, deploying the entire website becomes painless – scp the binary and restart the process.
Re:Don't build a general-purpose API to power your own front... by selcuka on Tuesday September 14, 2021 @01:43AM (#28520682)
You can still benefit from something like https://github.com/instantpage/instant.page as a poor man's replacement of Turbo(links).
Re:Don't build a general-purpose API to power your own front... by zeepzeep on Tuesday September 14, 2021 @03:11AM (#28521327)
> I embed all the html/css/js/images files into a binary and serve everything from memory. Zero disc reads. It's blazing fast.

I do that too. A friend "stole" that idea from the tour of go, I really like it. Just go generate before building to make add static files, go build, done. 1 binary, it just works.

Re:Don't build a general-purpose API to power your own front... by psd1 on Wednesday September 15, 2021 @05:45PM (#28544760)
Surely modern OSes cache files as memory-mapped files...? Given the availability of physical memory?