24 lines
454 B
TypeScript
24 lines
454 B
TypeScript
import express from "express";
|
|
|
|
import Database from "../core/db";
|
|
|
|
const app = express();
|
|
|
|
app.get("/", (req, res) => {
|
|
res.send("Welcome to the Dinosaur API!");
|
|
});
|
|
|
|
app.post("/node", async (req, res) => {
|
|
const node = await Database.createNode({
|
|
label: "hellosu",
|
|
other_nodes: new Map(),
|
|
edges: new Set(),
|
|
});
|
|
|
|
console.log("node", node);
|
|
|
|
res.json({ success: true });
|
|
});
|
|
|
|
console.log("Listening.");
|
|
app.listen(8605, "0.0.0.0");
|