Skip to content

Commit 014e6bf

Browse files
authored
fix rollupapi envoy (#167)
1 parent eec5ceb commit 014e6bf

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

config/development.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
brokers: '127.0.0.1:9092'
2-
grpc_addr: '127.0.0.1:50061'
2+
grpc_addr: '0.0.0.0:50061'
33
db: postgres://rollup:[email protected]:5433/rollup

examples/js/rest_client.ts

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
import axios, {AxiosInstance} from "axios";
1+
import axios, { AxiosInstance } from "axios";
22

33
class Client {
4-
client: AxiosInstance;
4+
client: AxiosInstance;
55

6-
constructor(server = process.env.REST_ADDR || "http://127.0.0.1:8766/api") {
7-
console.log("using REST", server);
8-
this.client = axios.create({ baseURL: server, timeout: 1000 });
9-
}
6+
constructor(
7+
server = process.env.REST_ADDR || "http://0.0.0.0:8765/rollupapi"
8+
) {
9+
console.log("using REST", server);
10+
this.client = axios.create({ baseURL: server, timeout: 1000 });
11+
}
1012

11-
async l2BlocksQuery() {
12-
let resp = await this.client.get(`/l2_blocks`);
13-
if (resp.status === 200) {
14-
return resp.data
15-
} else {
16-
throw new Error(`request failed with ${resp.status} ${resp.statusText}`)
17-
}
13+
async l2BlocksQuery() {
14+
let resp = await this.client.get(`/l2_blocks`);
15+
if (resp.status === 200) {
16+
return resp.data;
17+
} else {
18+
throw new Error(`request failed with ${resp.status} ${resp.statusText}`);
1819
}
20+
}
1921
}
2022

2123
let restClient = new Client();

0 commit comments

Comments
 (0)