turtle-express
Version:
`turtle-express` is kinda a framework or a library based on `express.js` with an opinionated express router with type safety and schema validation with zod. Also many [more features](https://github.com/mm-ninja-turtles/turtle-express/discussions/7) planni
41 lines (36 loc) • 711 B
text/typescript
import fetch, { Request, Response, Headers } from 'cross-fetch'
declare global {
export type fetch = typeof fetch
}
function bindFetchApi() {
global.fetch = fetch as any
global.Request = Request as any
global.Response = Response as any
global.Headers = Headers
}
bindFetchApi()
export { createRouter } from './core'
export {
errorHandler,
getContext,
getPagination,
paginationSchema,
} from './helpers'
export type {
Method,
HandlerOptions,
HandlerRequest,
Path,
PathOptions,
ResolverArgs,
ResolverReturnType,
ResolverTypes,
RouterOptions,
RouterReturnType,
SetupOptions,
} from './core'
export type {
GetContextOptions,
GetPaginationArgs,
GetPaginationReturnType,
} from './helpers'