]> Untitled Git - lemmy-ui.git/commitdiff
Updating to use api v3 lemmy-js-client.
authorDessalines <tyhou13@gmx.com>
Mon, 29 Mar 2021 17:20:22 +0000 (13:20 -0400)
committerDessalines <tyhou13@gmx.com>
Mon, 29 Mar 2021 17:20:22 +0000 (13:20 -0400)
package.json
src/server/index.tsx
src/shared/env.ts
yarn.lock

index 0897de9048f47912a886d8f9a655579ea38e8f7a..dbcd1c7475d7699df4418e3a1d6eccc14c61dd6d 100644 (file)
@@ -68,7 +68,7 @@
     "eslint-plugin-prettier": "^3.3.1",
     "husky": "^5.1.0",
     "iso-639-1": "^2.1.9",
-    "lemmy-js-client": "0.10.0-rc.12",
+    "lemmy-js-client": "0.10.0-rc.13",
     "lint-staged": "^10.5.4",
     "mini-css-extract-plugin": "^1.3.8",
     "node-fetch": "^2.6.1",
index 1729f16f01ea040803d76b0587b7f9b4e6c6e926..7873db3d7f57e74faa2684a4efe9e040dc92aa8a 100644 (file)
@@ -16,13 +16,13 @@ import { GetSite, GetSiteResponse, LemmyHttp } from "lemmy-js-client";
 import process from "process";
 import { Helmet } from "inferno-helmet";
 import { initializeSite } from "../shared/initialize";
-import { httpUri } from "../shared/env";
+import { httpBase } from "../shared/env";
 import { IncomingHttpHeaders } from "http";
 import { setOptionalAuth } from "../shared/utils";
 
 const server = express();
-const hostname = process.env['LEMMY_UI_HOST'] || 'localhost'
-const port = process.env['LEMMY_UI_PORT'] || 1234;
+const hostname = process.env["LEMMY_UI_HOST"] || "localhost";
+const port = process.env["LEMMY_UI_PORT"] || 1234;
 
 server.use(express.json());
 server.use(express.urlencoded({ extended: false }));
@@ -43,7 +43,7 @@ server.get("/*", async (req, res) => {
   let headers = setForwardedHeaders(req.headers);
 
   let initialFetchReq: InitialFetchRequest = {
-    client: new LemmyHttp(httpUri, headers),
+    client: new LemmyHttp(httpBase, headers),
     auth,
     path: req.path,
   };
index c99c0001f9c061ad3a350fecdbb2c5c68666fec8..0b094ced01fdbc1ef1188c16825ab9a1853e75dd 100644 (file)
@@ -33,9 +33,8 @@ if (isBrowser()) {
   secure = process.env.LEMMY_HTTPS == "true" ? "s" : "";
 }
 
-const httpBase = `http://${host}`; // Don't use secure here
-export const wsUri = `ws${secure}://${wsHost}/api/v2/ws`;
-export const httpUri = `${httpBase}/api/v2`;
+export const httpBase = `http://${host}`; // Don't use secure here
+export const wsUri = `ws${secure}://${wsHost}/api/v3/ws`;
 export const pictrsUri = `http${secure}://${host}/pictrs/image`;
 
 console.log(`httpbase: ${httpBase}`);
index 9602631b90d004296461ec9444e1656d85892568..b23cf7904f2db52e395954aaf1eb5b3232136228 100644 (file)
--- a/yarn.lock
+++ b/yarn.lock
@@ -5027,10 +5027,10 @@ lcid@^1.0.0:
   dependencies:
     invert-kv "^1.0.0"
 
-lemmy-js-client@0.10.0-rc.12:
-  version "0.10.0-rc.12"
-  resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.10.0-rc.12.tgz#b00fc55f78e3544b2ecf35a363e4f6781c7acd1e"
-  integrity sha512-GKdSBsjSxiWe3bDPgJXiHU8WDWvTDAgYUtQah+2LSjbTxP6G1ARBoZZmIf1ZFIIEBVH6I3n5apkiECK5/veZdg==
+lemmy-js-client@0.10.0-rc.13:
+  version "0.10.0-rc.13"
+  resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.10.0-rc.13.tgz#ea2e88857243374d7fbd49ee6b4bb94c34359d85"
+  integrity sha512-zodvYkwBYR7iP27ah6L/QPUphUUdq38kCH7QF2CUYBrsSAEkGmq2kdz+iusnQ1Ht7Ad80GtYycFprsZBveV5eQ==
 
 levn@^0.4.1:
   version "0.4.1"