@tableland/studio-api
v0.0.3
Published
[](./LICENSE) [;
export const apiRouter = appRouter(
store,
process.env.POSTMARK_API_KEY!,
`${baseUrl}/mesa.jpg`,
(seal) => `${baseUrl}/invite?seal=${seal}`,
process.env.DATA_SEAL_PASS!,
process.env.NODE_ENV === "development",
);
// Next route file
import { createContext } from "@tableland/studio-api";
import { fetchRequestHandler } from "@trpc/server/adapters/fetch";
import { apiRouter } from "location/of/setup/file";
const handler = async (req: Request) => {
console.log(`incoming request ${req.url}`);
return await fetchRequestHandler({
endpoint: "/api/trpc",
req,
router: apiRouter,
createContext,
onError: function (opts) {
console.error("Error:", JSON.stringify(opts, null, 4));
},
});
};
export { handler as GET, handler as POST };Development
See the web package for how the API is used in the context of Studio.
Contributing
PRs accepted. Studio is still under initial development, so if you are interested in helping out, feel free to connect on Discord: https://tableland.xyz/discord
Small note: If editing the README, please conform to the standard-readme specification.
License
MIT AND Apache-2.0, © 2021-2024 Tableland Network Contributors
