-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added support for async service creation
Its now possible to do things like: fastify.register(require("fastify-openapi-glue"), { specification: `${__dirname}/petstore-swagger.v2.json`, service: async () => { const dataProvider = await DataStore.create(); return new Service(dataProvider); } });
- Loading branch information
Hans Klunder
committed
Oct 16, 2019
1 parent
7fd9973
commit bf10721
Showing
3 changed files
with
26 additions
and
2 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
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,3 @@ | ||
// async service provider example | ||
const service = require("./service.js"); | ||
module.exports = async opts => new Promise(resolve => resolve(service(opts))); |
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