, 23 tweets, 6 min read
My Authors
Read all threads
Single File Application using FeatherHttp, C#9 top level statements and records. WIP.

#aspnetcore
LiteDB 5 doesn't support async methods yet (github.com/mbdavid/LiteDB…). It's coming at 5.5.
For building HTML, I can use nuget.org/packages/HtmlB…
There is off course a healthy limit on what you can accomplish using this 'everything in one page' approach but this is fun. We need to do more media hacking and build small experimental systems.
Small limited experimental systems are also great teaching tools.
FeatherHttp github is

github.com/featherhttp/fr…
For templating, Scriban is really good

github.com/lunet-io/scrib…
Sweet sweet record, nominal and positional.
Scriban is doing the heavy lifting in building a page layout
There isn't a nice non verbose way of building a HTML form using code.
look at that fancy null check
It's a pretty decent looking code considering everything is in one 255 lines of Program.cs code.
Now I need to add Anti Forgery token and HTML sanitizer
The code is here

github.com/dodyg/practica…

I will write a readme when I am done. You will need .NET 5 SDK Preview 7 to make it work. Get it from the daily build. It hasn't been released yet.
The rule for a Single File Application is simple. Everything must be contained in a Program.cs. That's it.

If you have assets or configuration file, they must be downloaded or created at runtime.
Cat tax
Dance break

Because we are building the html strings ourselves, nobody's gonna save us 😢. Antiforgery token is important.
This sweet code is all featherHttp
This is what happens when you don't have model binder
Sanitize input using github.com/mganss/HtmlSan…
This is a goofy looking code
Readme is updated at github.com/dodyg/practica…
Missing some Tweet in this thread? You can try to force a refresh.

Keep Current with dodyg

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!