Skip to content

Commit

Permalink
feat: render molecule.sh homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
charmful0x authored Mar 3, 2023
1 parent d10e040 commit 2297f3b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/api.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import express from "express";
import cors from "cors";
import assert from "node:assert";
import path from "node:path";
import { fileURLToPath } from "node:url";
import base64url from "base64url";

import { checkSubdomain } from "./utils/resolving.js";
import { getArTxObject } from "./molecules/ar/atoms/tx-gql.js";
Expand All @@ -27,17 +30,23 @@ import { readNearOracleState } from "./molecules/near/atoms/read-contract.js";
import { getEverTxObject } from "./molecules/everpay/atoms/tx.js";
import { getTokenPrice } from "./molecules/redstone/atoms/oracle.js";
import { postExmData } from "./molecules/exm/atoms/bundlr.js";
import base64url from "base64url";

const app = express();
const port = process.env.PORT || 3000;

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

app.use(
cors({
origin: "*",
})
);

app.get("/", (req, res) => {
res.sendFile(path.join(__dirname + "/views/homepage.html"));
});

app.get("/tx-gql/:txid", async (req, res) => {
try {
res.setHeader("Content-Type", "application/json");
Expand Down

0 comments on commit 2297f3b

Please sign in to comment.