Giter Club home page Giter Club logo

fastify-lambda's Introduction

fastify-lambda

This repository serves as a default starting project for building serverless functions (lambdas) on Netlify using Fastify and TypeScript. It provides a convenient setup for local development and deployment on the Netlify platform.

Getting Started

To run this project locally, follow these steps:

1. Clone the repository:

git clone https://github.com/your-username/fastify-lambda.git

2. Navigate to the project directory:

cd fastify-lambda

3. Install dependencies:

yarn install

Local Development

Run Locally with TypeScript Server

You can run the project locally using the following command:

yarn dev

This will start a TypeScript server on port 3000, watching the service.ts TypeScript file for changes during local development.

Run Locally with Netlify CLI

Alternatively, you can use the Netlify CLI for local development:

yarn netlify-dev

This command leverages the Netlify CLI to start a server on port 8888.

Transpile Typescript to Javascript

You can build the javascript file locally. The output will be a lambda/service.js file

yarn build

You can serve this file locally with yarn start. It's good to notice that we are adding this command to the netlify.toml file to be executed on deploy.

Missing parts

Subscriptions aren't still working at least on GraphiQL and it seems this is a reported issue but will add them once I figure it out.

Endpoints

  • GraphQL simple in-memory API: /.netlify/functions/service/graphql
  • GraphiQL Interface: /.netlify/functions/service/graphiql
  • Health Check: /.netlify/functions/service/ping

Feel free to customize and extend these endpoints to suit your specific requirements.

Happy coding! ๐Ÿš€

fastify-lambda's People

Contributors

federico-hv 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.