Skip to content

Commit

Permalink
feat: add option to render json instead of hbs (#22)
Browse files Browse the repository at this point in the history
Description
---
Add option to get json response instead of hbs. By calling any url with
`?json` parameter

Motivation and Context
---
It will be used in the react frontend.

How Has This Been Tested?
---
Manually.

What process can a PR reviewer use to test or verify this change?
---
Run the tari-explorer and change any url by adding `?json`.

<!-- Checklist -->
<!-- 1. Is the title of your PR in the form that would make nice release
notes? The title, excluding the conventional commit
tag, will be included exactly as is in the CHANGELOG, so please think
about it carefully. -->


Breaking Changes
---

- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify

<!-- Does this include a breaking change? If so, include this line as a
footer -->
<!-- BREAKING CHANGE: Description what the user should do, e.g. delete a
database, resync the chain -->
  • Loading branch information
leet4tari authored Nov 10, 2023
2 parents f7484a8 + 97bdb81 commit b91ef5b
Show file tree
Hide file tree
Showing 8 changed files with 1,973 additions and 7,237 deletions.
2 changes: 2 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const path = require("path");
const cookieParser = require("cookie-parser");
const logger = require("morgan");
const asciichart = require("asciichart");
const cors = require("cors");

var indexRouter = require("./routes/index");
var blocksRouter = require("./routes/blocks");
Expand Down Expand Up @@ -87,6 +88,7 @@ app.use(
);
app.use(cookieParser());
app.use(express.static(path.join(__dirname, "public")));
app.use(cors());

app.use("/", indexRouter);
app.use("/blocks", blocksRouter);
Expand Down
Loading

0 comments on commit b91ef5b

Please sign in to comment.