You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>This example was a leap ahead from our basic hello world. But having followed this, you know understand many of the patterns you'll need to know to build end-to-end server applications with Falco. Unsurprisingly, the entire program fits inside 118 LOC. One of the magnificent benefits of writing code in F#.</p>
162
162
<p><ahref="example-dependency-injection.html">Next: Example - Dependency Injection</a></p>
get "/" (Response.ofPlainText "Hello World!")
19
-
// ^-- associate GET / to plain text HttpHandler
20
-
]
21
-
22
16
let wapp = WebApplication.Create()
23
17
24
18
wapp.UseRouting()
25
-
.UseFalco(endpoints)
19
+
.UseFalco([
20
+
// ^-- activate Falco endpoint source
21
+
get "/" (Response.ofPlainText "Hello World!")
22
+
// ^-- associate GET / to plain text HttpHandler
23
+
])
24
+
.Run(Response.ofPlainText "Not found")
26
25
// ^-- activate Falco endpoint source
27
-
.Run()
28
26
</code></pre>
29
27
<p>First, we open the required namespaces. <code>Falco</code> bring into scope the ability to activate the library and some other extension methods to make the fluent API more user-friendly.</p>
30
28
<p><code>Microsoft.AspNetCore.Builder</code> enables us to create web applications in a number of ways, we're using <code>WebApplication.Create()</code> above. It also adds many other useful extension methods, that you'll see later.</p>
<p>Code is worth a thousand words. For the most up-to-date usage, the <ahref="https://github.com/pimbrouwers/Falco/tree/master/examples/">examples</a> directory contains a few sample applications.</p>
<p>The Crypto module provided functionality for: random numbers, salt generation and key derivation. The code in this module was really a veneer on top of the cryptographic providers in the base library. Extracting this code into your project would be dead simple. The <ahref="https://github.com/pimbrouwers/Falco/blob/25d828d832c0fde2dfff04775bea1eced9050458/src/Falco/Security.fs#L3">source</a> is permalinked here for such purposes.</p>
<p><ahref="https://github.com/pimbrouwers/Falco">Falco</a> is a toolkit for building fast and functional-first web applications using F#. You can think of it as <ahref="https://learn.microsoft.com/en-us/aspnet/core/tutorials/min-web-api?view=aspnetcore-8.0&tabs=visual-studio">minimal API</a> on <em>steroids</em>.</p>
23
15
<ul>
24
-
<li>Built upon the high-performance components of ASP.NET Core.</li>
25
-
<li>Optimized for building full-stack web applications quickly.</li>
16
+
<li>Designed for building pure F# full-stack web applications.</li>
17
+
<li>Built on the high-performance components of ASP.NET Core.</li>
26
18
<li>Seamlessly integrates with existing .NET Core middleware and libraries.</li>
<li><ahref="documentation/authentication.html">Authentication</a> and <ahref="documentation/cross-site-request-forgery.html">security</a> utilities.</li>
35
27
<li>Built-in support for <ahref="documentation/request.html#multipartform-data-binding">large uploads</a> and <ahref="documentation/response.html#content-disposition">binary responses</a>.</li>
<p>The best way to get started is by visiting the <ahref="https://falcoframework.com/docs">documentation</a>. For questions and support please use <ahref="https://github.com/pimbrouwers/Falco/discussions">discussions</a>. The issue list of this repo is <strong>exclusively</strong> for bug reports and feature requests. For chronological updates refer to the <ahref="CHANGELOG.html">changelog</a> is the best place to find chronological updates.</p>
45
-
<p>If you want to stay in touch, feel free to reach out on <ahref="https://twitter.com/falco_framework">Twitter</a>.</p>
46
-
<p>Have an article or video that you want to share? We'd love to hear from you! To add your content, visit this <ahref="https://github.com/pimbrouwers/Falco/discussions/82">discussion</a>.</p>
36
+
<p>The best way to get started is by visiting the <ahref="https://falcoframework.com/docs">documentation</a>. For questions and support please use <ahref="https://github.com/pimbrouwers/Falco/discussions">discussions</a>. For chronological updates refer to the <ahref="CHANGELOG.html">changelog</a> is the best place to find chronological updates.</p>
47
37
<h3id="related-libraries">Related Libraries</h3>
48
38
<ul>
49
39
<li><ahref="https://github.com/pimbrouwers/Falco.Markup">Falco.Markup</a> - an XML markup module primary used as the syntax for <ahref="https://www.falcoframework.com/docs/markup.html">authoring HTML with Falco</a>.</li>
<li><ahref="https://github.com/pimbrouwers/FalcoJournal">FalcoJournal</a> - A bullet journal built with Falco, .NET 5.x and ASP.NET Core.</li>
57
46
<li><ahref="https://github.com/adelarsq/falco_graphql_sample">Falco GraphQL Sample</a> - A sample showing how to use GraphQL on Falco using .NET 6.</li>
58
47
<li><ahref="https://github.com/jasiozet/falco-api-with-tests-template">Falco API with Tests Sample</a> - A sample project using Falco and unit testing.</li>
59
48
<li><ahref="https://github.com/galassie/FalcoSample">Falco + SQLite + Donald</a> - A demo project using Falco, <ahref="https://github.com/pimbrouwers/Donald">Donald</a>, and SQLite</li>
@@ -68,15 +57,14 @@ <h3 id="videos">Videos</h3>
68
57
<li>Ben Gobeil - <ahref="https://youtu.be/DTy5gIUWvpo">Why I'm Using Falco Instead Of Saturn | How To Switch Your Backend In SAFE Stack | StonkWatch Ep.13</a></li>
69
58
</ul>
70
59
<h2id="contribute">Contribute</h2>
71
-
<p>Thank you for considering contributing to Falco, and to those who have already contributed! We appreciate (and actively resolve) PRs of all shapes and sizes.</p>
72
60
<p>We kindly ask that before submitting a pull request, you first submit an <ahref="https://github.com/pimbrouwers/Falco/issues">issue</a> or open a <ahref="https://github.com/pimbrouwers/Falco/discussions">discussion</a>.</p>
73
61
<p>If functionality is added to the API, or changed, please kindly update the relevant <ahref="docs">document</a>. Unit tests must also be added and/or updated before a pull request can be successfully merged.</p>
74
-
<p>Only pull requests which pass all build checks and comply with the general coding guidelines can be approved.</p>
62
+
<p>Only pull requests which pass all build checks and comply with the general coding standard can be approved.</p>
75
63
<p>If you have any further questions, submit an <ahref="https://github.com/pimbrouwers/Falco/issues">issue</a> or open a <ahref="https://github.com/pimbrouwers/Falco/discussions">discussion</a> or reach out on <ahref="https://twitter.com/falco_framework">Twitter</a>.</p>
76
64
<h2id="why-falco">Why "Falco"?</h2>
77
65
<p><ahref="https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel">Kestrel</a> has been a game changer for the .NET web stack. In the animal kingdom, "Kestrel" is a name given to several members of the falcon genus. Also known as "Falco".</p>
78
66
<h2id="find-a-bug">Find a bug?</h2>
79
67
<p>There's an <ahref="https://github.com/pimbrouwers/Falco/issues">issue</a> for that.</p>
80
68
<h2id="license">License</h2>
81
-
<p>Built with ♥ by <ahref="https://github.com/pimbrouwers">Pim Brouwers</a> in Toronto, ON. Licensed under <ahref="https://github.com/pimbrouwers/Falco/blob/master/LICENSE">Apache License 2.0</a>.</p>
0 commit comments