import {useState} from "react"; import URI from "urijs"; import {Namespace} from "../nws-api/types"; import {useNWSAccount, useNWSAuthKey} from "../nws-api/hooks"; import {useSearchParams} from "react-router-dom"; export default function CreateCruisePage() { const [page, setPage] = useState('info'); const [strat, setStrat] = useState<'raw-html' | 'react-js'>('raw-html'); const [owner, setOwner] = useState(''); const [repo, setRepo] = useState(''); const [name, setName] = useState(''); const [gitUriInput, setGUI] = useState(''); const [hostUriInput, setHUI] = useState(''); const authKey = useNWSAuthKey(); const acct = useNWSAccount(); const [search, useSearch] = useSearchParams(); function deploy() { fetch("https://api-nws.nickorlow.com/" + acct!.id + "/service", { method: 'POST', headers: { "Authorization": authKey, "Content-Type": "application/json" }, body: JSON.stringify({ "serviceName": name, "containerUrl": `ghcr.io/${owner}/${repo}`, "namespaceId": search.get("namespaceId"), "serviceUrl": hostUriInput, }) }).then((response)=> { if(response.status === 200) { } }).catch((ex) =>{ alert(ex) }); } return (
Don't see your technology/framework? Email me: nws-support@nickorlow.com
Other git hosting providers are not currently supported through the Web UI
The repo must be public to create it through the Web UI
{setGUI(e.currentTarget.value)}}/> curl -s https://raw.githubusercontent.com/nickorlow/nws-ghactions-templates/main/add-nws.sh | bash -s {strat} {owner} {repo}
If your DNS provider is:
Type: CNAME
Name: @ ({hostUriInput})
Value: entry.nws.nickorlow.com
Type: CNAME
Name: {new URI(hostUriInput).subdomain()} ({new URI(hostUriInput).hostname()})
Value: entry.nws.nickorlow.com