-
-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated fastify plugin to work with fastify v5
- Loading branch information
Showing
5 changed files
with
552 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { AltairFastify } from '../../packages/altair-fastify-plugin/dist'; | ||
|
||
// const Fastify = require("fastify"); | ||
import Fastify from 'fastify'; | ||
// const AltairFastify = require("altair-fastify-plugin"); | ||
// import AltairFastify from 'altair-fastify-plugin'; | ||
|
||
const app = Fastify(); | ||
|
||
// ... | ||
|
||
app.register(AltairFastify, { | ||
/** | ||
* All these are the defaults. | ||
*/ | ||
path: '/altair', | ||
baseURL: '/altair/', | ||
endpointURL: '/graphql', | ||
}); | ||
|
||
// ... | ||
|
||
// Altair available at localhost:3000/altair | ||
app.listen({ port: 3000 }, () => { | ||
console.log('Server listening at http://localhost:3000'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "fastify-v4", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@types/node": "^22.7.4", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5.6.2" | ||
}, | ||
"dependencies": { | ||
"fastify": "^5.0.0" | ||
}, | ||
"scripts": { | ||
"start": "ts-node index.ts" | ||
} | ||
} |
Oops, something went wrong.