UNPKG

@chillicream/nitro-embedded

Version:
65 lines (45 loc) 1.3 kB
# Nitro GraphQL IDE _GraphQL IDE for Devs_ ## Description The IDE to create, explore, manage, and test GraphQL APIs with ease. ## Installation Install this package in your project: ```sh npm install @chillicream/nitro-embedded --save-dev # or yarn add @chillicream/nitro-embedded --dev # or pnpm add @chillicream/nitro-embedded --save-dev ``` ## Recipes <details id="express" open> <summary><a href="#express"><sub><sup>🔗</sup></sub></a> Usage with <a href="https://expressjs.com/">express</a></summary> <hr> Install the <i>middleware</i> in your project: ```sh npm install @chillicream/nitro-express-middleware --save-dev # or yarn add @chillicream/nitro-express-middleware --dev # or pnpm add @chillicream/nitro-express-middleware --save-dev ``` Add it to your `/graphql` route or any other (e.g., `/nitro`): ```javascript import express from "express"; import nitroMiddleware from "@chillicream/nitro-express-middleware"; // ... const app = express(); app.use( "/graphql", // for `cdn` hosted version nitroMiddleware({ mode: "cdn" }) // for `embedded` version // nitroMiddleware({ mode: "embedded" }), // place here your graphql middleware and others ); app.listen(3000, () => { console.log(`GraphQL on http://localhost:3000/graphql`); }); ``` <hr> </details>