@kimkun07/mindmap_mind-api
v1.0.4
Published
mind-api
Downloads
3
Readme
About
mind-api
is an API for MindElixir
Project.
It is used for an endpoint of server providing data for a mindmap.
Related Link
How to use
- Install
mind-api
- Server
- Provide
MindResponse
- Provide
- Client
- Fetch
MindResponse
- Fetch
Install mind-api
npm i -D @kimkun07/mindmap_mind-api
Provide MindResponse
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
});
Fetch MindResponse
import { MindResponse } from "@kimkun07/mindmap_mind-api";
let httpResponse = await fetch(url);
let mindResponse: MindResponse = await httpResponse.json();
How to develop
- Publish to npm
npm run build npm version patch npm publish --access public
- Update from usage
npm outdated npm update @kimkun07/mindmap_mind-api