Getting started
How to write your first endpoint with Ikkan
There is no obligations about how you should structure your files, but here is a recommended structure:
config.ts
This file is used to define how your endpoint will behave. It should export IkkanConfig objects, that will be used to configure actual implementations of your endpoint and client-side/server-side functions.\
route.ts
It is the file that Next.js uses to define the route of your endpoint.
It should export a function that will be used when calling to that specific endpoint. You don't have to write much in this file, as Ikkan will take care of the boilerplate for you.
You can export multiple functions, if you endpoint supports multiple methods.
bridge.ts
This file is used to define the client-side or server-side function that will call your endpoint.
It is you responsibility as a developer to export relevant functions (server-side, client-side without SWR, client-side with SWR) that will call the endpoint.