GithubHelp home page GithubHelp logo

grantneale / fable-firebase-functions Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gamurs-group/fable-firebase-functions

0.0 0.0 0.0 239 KB

Fable bindings for the firebase-functions npm package

License: MIT License

Batchfile 0.26% F# 98.13% Shell 1.61%

fable-firebase-functions's Introduction

Fable.FirebaseFunctions

Fable bindings for the firebase-functions npm package.

Nuget Packages

Stable Prerelease
NuGet Badge NuGet Badge

Example

express.RequestHandler function

module Example.Handler

open Fable.FirebaseAdmin.Globals

open Fable.FirebaseFunctions
open Fable.FirebaseFunctions.Globals

// initialise the admin SDK
admin.initializeApp()
|> ignore

// Define a firebase function called 'test'
let test =
    let handler (request : Request) (response : Response) =
        response
            .send("Testing is fun")
            .``end``()

    functions.https.onRequest(handler)

express.Application

module Example.Application

open Fable.FirebaseAdmin.Globals

open Fable.FirebaseFunctions
open Fable.FirebaseFunctions.Globals

open Fable.Import
open Fable.Core.JsInterop

// initialise the admin SDK
admin.initializeApp()
|> ignore



// Create an express.js application
let private app = express.Invoke()

let private nameHandler =
    fun (req : Request) (res : Response) _ ->
        res.send("Jim Bob") |> box

let private ageHandler =
    fun (req : Request) (res : Response) _ ->
        res.send("23") |> box

// Add some endpoints
app.get(!^"/name", nameHandler) |> ignore
app.get(!^"/age", ageHandler) |> ignore

// Deploy the application as a cloud function at /api
let api = Globals.functions.https.onRequest(app)

Development

Building

Make sure the following requirements are installed in your system:

Then you just need to type ./build.cmd or ./build.sh

Release

In order to push the package to nuget.org you need to add your API keys to NUGET_KEY environmental variable. You can create a key here.

#### 0.2.0 - 30.04.2017
* FEATURE: Does cool stuff!
* BUGFIX: Fixes that silly oversight
  • You can then use the Release target. This will:
    • make a commit bumping the version: Bump version to 0.2.0
    • publish the package to nuget
    • push a git tag

./build.sh Release

fable-firebase-functions's People

Contributors

grantneale avatar andrewnguyenism avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.