GithubHelp home page GithubHelp logo

gatsby-funcjam-21's Introduction

Gatsby FuncJam '21 - Project Bunting

A Gatsby #FuncJam submission, created by Nicholas Martin - an A/B testing / feature flag platform made with โ˜• and FaunaDB! You can find most details on the demo site

  1. Start developing.

    To get started clone this repo locally and run yarn install to add all necessary packages.

    You will also need to set up the FaunaDB environment variables in .env.development. Notably, you will need to set FAUNADB_SECRET.

    yarn install
    yarn develop
  2. Open the code and start customizing!

    Your site is now running at http://localhost:8000! You can use the UI on the index page to test the functions or directly access them at http://localhost:8000/api/form

    Try editing the function in src/api/form.ts or form at src/pages/index.js

  3. Deploy

You can deploy this example on Gatsby Cloud by copying the example into a new repo and connecting that to Gatsby Cloud.

Dynamic API routing?

I misread the documentation (https://www.gatsbyjs.com/docs/reference/functions/routing/) as I thought I could use dynamic routes using square brackets, eg. /api/[userId], similar syntax to client-only routes. Oddly enough, it works locally, even when serving a build, but doesn't work in Gatsby Cloud... sad face emoji

res.params.userId is undefined, but oddly the path is still correctly routed...

For now, I switched to using query, but left in the original dynamic path for visibility.

Submission Checklist

Helpful Links

Read the Gatsby functions docs. Check out this video all about Gatsby functions Take a look at the Functions Use Cases over here.

gatsby-funcjam-21's People

Contributors

dgiordano33 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.