v0.10.2
In this release express is removed as dependency. New basePath
option is required to resolve sofa routes properly
app.use(
'/api',
useSofa({
basePath: '/api',
schema,
})
);
Added new server framework agnostic api
const invokeSofa = createSofaRouter({
basePath: '/api',
schema,
});
...
const response = await invokeSofa({
method: req.method,
url: req.url,
body: JSON.parse(await getStream(req)),
contextValue: {
req
},
});