falcordotnet - Falcor.Server 0.1.0-alpha-18

Falcor.NET router implementation. To use Falcor on the server, use the Falcor.Server.Owin package.

PM> Install-Package Falcor.Server -Version 0.1.0-alpha-18 -Source https://www.myget.org/F/falcordotnet/api/v3/index.json

Copy to clipboard

> nuget.exe install Falcor.Server -Version 0.1.0-alpha-18 -Source https://www.myget.org/F/falcordotnet/api/v3/index.json

Copy to clipboard

> dotnet add package Falcor.Server --version 0.1.0-alpha-18 --source https://www.myget.org/F/falcordotnet/api/v3/index.json

Copy to clipboard
<PackageReference Include="Falcor.Server" Version="0.1.0-alpha-18" />
Copy to clipboard
source https://www.myget.org/F/falcordotnet/api/v3/index.json

nuget Falcor.Server  ~> 0.1.0-alpha-18
Copy to clipboard

> choco install Falcor.Server --version 0.1.0-alpha-18 --source https://www.myget.org/F/falcordotnet/api/v2

Copy to clipboard
Import-Module PowerShellGet
Register-PSRepository -Name "falcordotnet" -SourceLocation "https://www.myget.org/F/falcordotnet/api/v2"
Install-Module -Name "Falcor.Server" -RequiredVersion "0.1.0-alpha-18" -Repository "falcordotnet" -AllowPreRelease
Copy to clipboard

Falcor.NET Build status Gitter

What is Falcor?

Falcor is an approach pioneered by Netflix that enables you to quickly build a data-driven APIs that deliver efficient payloads to a variety of client form factors, and is able to adapt quickly to changing data access patterns as your application evolves.

Falcor provides many of the benefits of both REST and RPC, while addressing shortcomings these approaches face when building modern web applications.

Release Status: Developer Preview

Falcor.NET will remain in developer preview until a stable client and server reference version is released from Netflix all baseline functionality is implemented. Follow progress on this GitHub issue: https://github.com/falcordotnet/falcor.net/issues/1

NuGet Packages NuGet package version Pre-release builds

Although Falcor.NET is still in pre-release, regular updates are posted to NuGet.org. More frequent pre-release builds can be found on MyGet.

Getting Started

To get started with Falcor.NET, follow these steps:

  1. In your ASP.NET web project, install the Falcor.Server.Owin NuGet package:
PM> Install-Package Falcor.Server.Owin -Pre
  1. Create your application router to match paths to a virtual JSON Graph model:
public class HelloWorldRouter : FalcorRouter
{
    public HelloWorldRouter()
    {
        // Route to match a JSON path, in this case the 'message' member
        // of the root JSON node of the virtual JSON Graph
        Get["message"] = async _ =>
        {
            var result = await Task.FromResult(Path("message").Atom("Hello World"));
            return Complete(result);
        };
        // Define additional routes for your virtual model here
    }
}

Note: For a more realistic example router, see the example Netflix router which is part of Falcor.Examples.Netflix.Web project that you can run yourself to see the router in action.

  1. In your OWIN startup class, configure your Falcor.NET router endpoint:
public class Startup
{
    public void Configuration(IAppBuilder app)
    {
        app.UseFalcor("/helloWorldModel.json", routerFactory: config => new HelloWorldRouter());
        ...
    }
}

If you are using IIS (and for most development environments), ensure the web.config has a similar handler configured for your model endpoint:

<system.webServer>
  <handlers>
    <add name="NetflixFalcorModelHandler" path="model.json" verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
  </handlers>
</system.webServer>
  1. Using falcor.js in your client, create a new Falcor model, specifying the URL of your new endpoint for your datasource:
var model = new falcor.Model({
  source: new falcor.HttpDataSource('/helloWorldModel.json')
});
  1. You've done all you need to talk to your router, call your model like so:
model.get('message').then(function(json) {
  console.log(json);
});
// Result:
{
  json: {
    message: "Hello World!"
  }
}

When To Use Falcor

**_Consider the Falcor approach when you are developing a client/server architecture that is intended to provide a rich client user experience._**
Good Fit Poor Fit
Fetching large amounts of small resources (e.g. web components, JSON, metadata, etc.) Fetching small amounts of large resources (e.g. web pages, images, files, etc.)
Aggregating heterogeneous services efficiently (e.g. microservices or loosley-coupled modules) Speaking to a single back-end data source or service provider
Delivering responsive and capable end-user client experiences Systems integration and public APIs; static websites
Heterogeneous and evolving data access patterns (multiple devices, changing use cases)

License

Apache 2.0

See updates on pre-release progress and milestones at https://github.com/falcordotnet/falcor.net/issues/1

  • Any 0.0
    • Falcor (>= 0.1.0-alpha-18)
    • Newtonsoft.Json (>= 7.0.1)
    • Rx-Main (>= 2.2.5)
    • Sprache (>= 2.0.0.47)
  • .NETFramework 4.5: 4.5.0.0

Owners

Craig Smitham

Authors

Craig Smitham

Project URL

https://github.com/falcordotnet/falcor.net

License

Apache-2.0

Tags

Falcor Router Data Web API Reactive

Info

828 total downloads
17 downloads for version 0.1.0-alpha-18
Download (33.29 KB)
Found on the current feed only

Package history

Version Size Last updated Downloads Mirrored?
0.1.4-alpha-55 34.17 KB Sat, 21 Nov 2015 05:08:16 GMT 30
0.1.4-alpha-54 34.17 KB Sat, 21 Nov 2015 04:19:49 GMT 19
0.1.4-alpha-53 34.17 KB Sat, 21 Nov 2015 01:22:20 GMT 18
0.1.4-alpha-51 34.22 KB Fri, 20 Nov 2015 23:53:34 GMT 17
0.1.4-alpha-50 34.22 KB Fri, 20 Nov 2015 10:10:48 GMT 17
0.1.4-alpha-49 34.22 KB Thu, 19 Nov 2015 13:40:57 GMT 21
0.1.4-alpha-48 34.22 KB Thu, 19 Nov 2015 00:34:05 GMT 18
0.1.4-alpha-47 34.24 KB Tue, 10 Nov 2015 00:08:02 GMT 18
0.1.4-alpha-46 34.24 KB Mon, 09 Nov 2015 16:48:02 GMT 16
0.1.4-alpha-45 34.23 KB Mon, 09 Nov 2015 14:44:21 GMT 19
0.1.4-alpha-44 34.23 KB Mon, 09 Nov 2015 12:26:33 GMT 15
0.1.4-alpha-43 34.23 KB Mon, 09 Nov 2015 02:43:29 GMT 17
0.1.4-alpha-42 34.23 KB Mon, 09 Nov 2015 02:00:06 GMT 17
0.1.4-alpha-40 34.23 KB Sun, 08 Nov 2015 02:24:01 GMT 18
0.1.4-alpha-39 34.23 KB Fri, 06 Nov 2015 22:18:56 GMT 19
0.1.4-alpha-38 34.23 KB Thu, 05 Nov 2015 15:51:39 GMT 18
0.1.4-alpha-37 34.23 KB Thu, 05 Nov 2015 12:52:22 GMT 17
0.1.4-alpha-36 34.21 KB Wed, 04 Nov 2015 15:50:49 GMT 19
0.1.4-alpha-35 34.21 KB Wed, 04 Nov 2015 15:35:31 GMT 19
0.1.3-alpha-34 34.22 KB Wed, 04 Nov 2015 01:11:36 GMT 19
0.1.3-alpha-32 34.21 KB Mon, 02 Nov 2015 19:28:07 GMT 17
0.1.3-alpha-30 34.21 KB Sun, 01 Nov 2015 00:34:12 GMT 16
0.1.2-alpha-29 34.28 KB Sat, 31 Oct 2015 14:48:28 GMT 17
0.1.2-alpha-28 33.57 KB Tue, 27 Oct 2015 15:35:31 GMT 18
0.1.2-alpha-27 33.57 KB Mon, 26 Oct 2015 22:13:33 GMT 17
0.1.2-alpha-26 33.57 KB Mon, 26 Oct 2015 05:02:32 GMT 16
0.1.2-alpha-25 33.57 KB Mon, 26 Oct 2015 05:01:01 GMT 16
0.1.2-alpha-24 33.57 KB Mon, 26 Oct 2015 04:42:48 GMT 18
0.1.2-alpha-23 33.57 KB Mon, 26 Oct 2015 02:37:27 GMT 20
0.1.2-alpha-22 33.58 KB Sun, 25 Oct 2015 21:22:07 GMT 18
0.1.2-alpha-21 33.57 KB Sun, 25 Oct 2015 20:57:53 GMT 17
0.1.2-alpha-20 33.57 KB Sun, 25 Oct 2015 20:51:47 GMT 16
0.1.2-alpha-19 33.57 KB Sat, 24 Oct 2015 21:22:03 GMT 20
0.1.0-alpha-18 33.29 KB Sat, 24 Oct 2015 20:17:42 GMT 17
0.1.0-alpha-17 32.55 KB Fri, 23 Oct 2015 04:40:47 GMT 18
0.1.0-alpha-16 32.44 KB Fri, 23 Oct 2015 03:52:51 GMT 18
0.0.7-pre-15 32.29 KB Thu, 22 Oct 2015 03:16:56 GMT 17
0.0.7-pre-14 32.29 KB Thu, 22 Oct 2015 03:11:35 GMT 18
0.0.7-pre-13 32.29 KB Thu, 22 Oct 2015 03:08:38 GMT 19
0.0.7-pre-12 32.29 KB Thu, 22 Oct 2015 03:06:30 GMT 17
0.0.4-pre-9 24.52 KB Mon, 19 Oct 2015 19:00:05 GMT 19
0.0.4-pre-7 17.98 KB Sat, 17 Oct 2015 21:29:59 GMT 18
0.0.4-pre-6 14.13 KB Thu, 15 Oct 2015 13:22:15 GMT 16
0.0.4-pre-10 30.71 KB Wed, 21 Oct 2015 02:42:25 GMT 19
0.0.3-pre-5 8.09 KB Wed, 23 Sep 2015 03:25:47 GMT 17
0.0.2-pre-1 8.11 KB Wed, 23 Sep 2015 03:23:44 GMT 18