Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DPLT-1044] Pass required JSON content type header #121

Merged
merged 1 commit into from
Jun 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions indexer-js-queue-handler/latest-post-metrics-writer.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import fetch from "node-fetch";
import AWS from "aws-sdk";

import Metrics from './metrics.js'
import Metrics from "./metrics.js";

export const handler = async () => {
const metrics = new Metrics("QueryAPI");

const response = await fetch("https://api.near.social/index", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
action: "post",
key: "main",
Expand All @@ -21,7 +24,7 @@ export const handler = async () => {
const body = await response.text();

if (response.status !== 200) {
throw new Error(body);
throw new Error(body);
}

const [{ blockHeight }] = JSON.parse(body);
Expand Down