chore: extract api host to const

This commit is contained in:
Kieran 2023-01-25 11:49:56 +00:00
parent 446be363f6
commit fe868a601a
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
4 changed files with 11 additions and 5 deletions

View File

@ -1,5 +1,10 @@
import { RelaySettings } from "Nostr/Connection"; import { RelaySettings } from "Nostr/Connection";
/**
* Add-on api for snort features
*/
export const ApiHost = "https://api.snort.social";
/** /**
* Websocket re-connect timeout * Websocket re-connect timeout
*/ */
@ -93,5 +98,4 @@ export const TidalRegex = /tidal\.com\/(?:browse\/)?(\w+)\/([a-z0-9-]+)/i;
/** /**
* SoundCloud regex * SoundCloud regex
*/ */
export const SoundCloudRegex = /soundcloud\.com\/(?!live)([a-zA-Z0-9]+)\/([a-zA-Z0-9-]+)/ export const SoundCloudRegex = /soundcloud\.com\/(?!live)([a-zA-Z0-9]+)\/([a-zA-Z0-9-]+)/

View File

@ -1,3 +1,4 @@
import { ApiHost } from "Const";
import ProfilePreview from "Element/ProfilePreview"; import ProfilePreview from "Element/ProfilePreview";
import ZapButton from "Element/ZapButton"; import ZapButton from "Element/ZapButton";
import { HexKey } from "Nostr"; import { HexKey } from "Nostr";
@ -24,7 +25,7 @@ const DonatePage = () => {
const [splits, setSplits] = useState<Splits[]>([]); const [splits, setSplits] = useState<Splits[]>([]);
async function loadSplits() { async function loadSplits() {
let rsp = await fetch("https://api.snort.social/api/v1/revenue/splits"); let rsp = await fetch(`${ApiHost}/api/v1/revenue/splits`);
if(rsp.ok) { if(rsp.ok) {
setSplits(await rsp.json()); setSplits(await rsp.json());
} }

View File

@ -1,4 +1,4 @@
import { RecommendedFollows } from "Const"; import { ApiHost, RecommendedFollows } from "Const";
import AsyncButton from "Element/AsyncButton"; import AsyncButton from "Element/AsyncButton";
import FollowListBase from "Element/FollowListBase"; import FollowListBase from "Element/FollowListBase";
import ProfilePreview from "Element/ProfilePreview"; import ProfilePreview from "Element/ProfilePreview";
@ -8,7 +8,7 @@ import { useSelector } from "react-redux";
import { RootState } from "State/Store"; import { RootState } from "State/Store";
import { bech32ToHex } from "Util"; import { bech32ToHex } from "Util";
const TwitterFollowsApi = "https://api.snort.social/api/v1/twitter/follows-for-nostr"; const TwitterFollowsApi = `${ApiHost}/api/v1/twitter/follows-for-nostr`;
export default function NewUserPage() { export default function NewUserPage() {
const [twitterUsername, setTwitterUsername] = useState<string>(""); const [twitterUsername, setTwitterUsername] = useState<string>("");

View File

@ -1,3 +1,4 @@
import { ApiHost } from "Const";
import Nip5Service from "Element/Nip5Service"; import Nip5Service from "Element/Nip5Service";
import './Verification.css' import './Verification.css'
@ -6,7 +7,7 @@ export default function VerificationPage() {
const services = [ const services = [
{ {
name: "Snort", name: "Snort",
service: "https://api.snort.social/api/v1/n5sp", service: `${ApiHost}/api/v1/n5sp`,
link: "https://snort.social/", link: "https://snort.social/",
supportLink: "https://snort.social/help", supportLink: "https://snort.social/help",
about: <>Our very own NIP-05 verification service, help support the development of this site and get a shiny special badge on our site!</> about: <>Our very own NIP-05 verification service, help support the development of this site and get a shiny special badge on our site!</>