mind-api
is an API for MindElixir
Project.
It is used for an endpoint of server providing data for a mindmap.
Related Link
Table of Contents
- Install
mind-api
- Server
- Provide
MindResponse
- Provide
- Client
- Fetch
MindResponse
- Fetch
npm i -D @kimkun07/mindmap_mind-api
import { MindResponse } from "@kimkun07/mindmap_mind-api";
server.get("/", async function (req: Request, res: Response) {
let result: MindResponse = {
status: "Page Retrieve Success",
rawNodeData: await get_node(process.env.NOTION_PAGE_ID_ROOT!), // NodeObj
};
res.json(result); // json of MindResponse
});
import { MindResponse } from "@kimkun07/mindmap_mind-api";
let httpResponse = await fetch(url);
let mindResponse: MindResponse = await httpResponse.json();
- Publish to npm
npm run build npm version patch npm publish --access public
- Update from usage
npm outdated npm update @kimkun07/mindmap_mind-api