diff --git a/api.ts b/api.ts index d575a8e..acf220c 100644 --- a/api.ts +++ b/api.ts @@ -2,8 +2,12 @@ import { Router } from "https://deno.land/x/oak/mod.ts"; import { getBlocks } from "./blocks.ts"; import { getblockchaininfo, getblockcount, getblockhash } from "./jsonrpc/index.ts"; +import Pageviews from "./pageviews/index.ts"; const router = new Router(); + +router.use(Pageviews); + router .get("/getblockchaininfo", async (context) => { const info = await getblockchaininfo(); diff --git a/index.ts b/index.ts index 94f77c4..42b9933 100644 --- a/index.ts +++ b/index.ts @@ -3,14 +3,11 @@ import { Application, send } from "https://deno.land/x/oak@v7.3.0/mod.ts"; import config from "./config/config.ts"; import router from "./api.ts"; import { bootstrapBlocks } from "./blocks.ts"; -import Pageviews from "./pageviews/index.ts"; await bootstrapBlocks(); const app = new Application(); -app.use(Pageviews); - app.use(router.routes()); app.use(async (context) => {