API
Xink class
Section titled “Xink class”import { Xink } from "@xinkjs/xink"
const api = new Xink()
You can pass a configuration object when creating the new instance.
{ check_origin: boolean; // protect against CSRF attacks; default true base_path: string; // the router's base path for all created routes; default ''}
Handles a Request. You don’t typically call this method directly, since a lot of runtimes automatically handle calling it.
// typicalimport { Xink } from "@xinkjs/xink"
const api = new Xink()
export default api
// if neededimport { Xink } from "@xinkjs/xink"
const api = new Xink()
export default { fetch(request, env, ctx) { // do something
return api.fetch(request, env, ctx) }}