6 ms·
Niflet is my first foray into modern web development (I'm a database developer by day), so I kept it simple, just Go and SQLite. I'm using Go's webserver, which
by genwin 13y ago
Niflet is my first foray into modern web development (I'm a database developer by day), so I kept it simple, just Go and SQLite. I'm using Go's webserver, which is basic but wasn't hard to extend to do compression and other niceties. Templating is via Go's template package. SQLite gets embedded, making the entire app a single 5 MB file. A free Dropbox account is used for nightly backup, handled by a scheduled goroutine (Go's concurrency feature).
For a heavyweight web app that needs to scale to multiple machines I would've done things differently. It turns out that Go is so fast that needing to scale would be a luxury problem for me. In theory I can serve 70M users spread over a 10-hour day for < $100 a month.
- sbov 13y agoThe standard library templating in Go is one of my favorite features. Between html.template and text.template, I probably use it in over half of the programs I've written.
- mseepgood 13y agoI love the context aware escaping in html/template. I haven't seen this in other template engines before.
- soccerdave 13y agoHow did you embed your templates into the binary?
- jackielii 13y agovia string literals http://golang.org/ref/spec#String_literals http://golang.org/ref/spec#String_literals
- genwin 13y agoThe templates are on disk and their contents passed to the template function on initialization. So yes, the app is not a single file. I forgot about these files because they rarely change, hence are rarely deployed.