Browse Source

Fix buggy page view tracking

refactor
Hampus Sjöberg 4 years ago
parent
commit
fa60b4bf87
  1. 4
      api.ts
  2. 3
      index.ts

4
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();

3
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) => {

Loading…
Cancel
Save