2023-03-23 18:32:34 +00:00
|
|
|
import express from "express";
|
|
|
|
|
|
|
|
import Database from "../core/db";
|
2023-03-23 02:24:46 +00:00
|
|
|
|
|
|
|
const app = express();
|
|
|
|
|
|
|
|
app.get("/", (req, res) => {
|
|
|
|
res.send("Welcome to the Dinosaur API!");
|
|
|
|
});
|
|
|
|
|
2023-03-23 18:32:34 +00:00
|
|
|
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.");
|
2023-03-23 02:24:46 +00:00
|
|
|
app.listen(8605, "0.0.0.0");
|