Skip to content

v0.10.2

Compare
Choose a tag to compare
@TrySound TrySound released this 12 Feb 10:52
· 844 commits to master since this release

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
  },
});