Giter Club home page Giter Club logo

guide-fastify-example's Introduction

Speakeasy Logo

Speakeasy Fastapi OpenAPI Example

This example Fastapi app demonstrates Speakeasy-recommended practices for generating clear OpenAPI specifications and SDKs.

This project was bootstrapped with Fastify-CLI.

Prerequisites

You need to have Node.js the Fastify CLI installed on your system to run this project. If you don't have these installed, you can download them from here and here.

To generate an SDK, you'll also need the Speakeasy CLI installed, or use the Speakeasy dashboard.

Installation

To install the application on your local machine:

  1. Clone the repository:
git clone https://github.com/speakeasy-api/speakeasy-fastify-example.git
  1. Navigate into the directory:
cd speakeasy-fastify-example
  1. Install all dependencies for the application using NPM:
npm install
  1. Install Speakeasy CLI:
brew install speakeasy-api/homebrew-tap/speakeasy

Running the application

Start the server:

npm run start

For development

You can use the provided script to run the application in development mode. It will watch for any changes in the source code and automatically restart the server.

npm run dev

Working with the OpenAPI specification

To generate the OpenAPI specification file in JSON format, run:

npm run openapi

To generate an SDK, run:

npm run sdk

To generate an SDK in a different language, run Speakeasy and specify the language:

speakeasy generate sdk \
    --schema openapi.json \
    --lang typescript \
    --out ./sdk

License

This project is licensed under the terms of the Apache 2.0 license.

guide-fastify-example's People

Contributors

ndimares avatar

Watchers

David Alberto Adler avatar Thomas Rooney avatar Simon Yu avatar  avatar  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.