update frontend DNS to use dns.web

This commit is contained in:
Face
2025-09-05 16:22:56 +03:00
parent 09e2af17c4
commit f2fc528f7c
6 changed files with 177 additions and 13 deletions

View File

@@ -74,7 +74,7 @@ end
local function loadDomains()
print('Loading domains...')
local response = fetch('gurt://localhost:8877/auth/domains?page=1&limit=100', {
local response = fetch('gurt://dns.web/auth/domains?page=1&limit=100', {
headers = {
Authorization = 'Bearer ' .. authToken
}
@@ -95,7 +95,7 @@ local function checkAuth()
if authToken then
print('Found auth token, checking validity...')
local response = fetch('gurt://localhost:8877/auth/me', {
local response = fetch('gurt://dns.web/auth/me', {
headers = {
Authorization = 'Bearer ' .. authToken
}

View File

@@ -29,7 +29,7 @@ local renderRecords
local function deleteRecord(recordId)
print('Deleting DNS record: ' .. recordId)
local response = fetch('gurt://localhost:8877/domain/' .. domainName .. '/records/' .. recordId, {
local response = fetch('gurt://dns.web/domain/' .. domainName .. '/records/' .. recordId, {
method = 'DELETE',
headers = {
Authorization = 'Bearer ' .. authToken
@@ -57,7 +57,7 @@ end
-- Actual implementation
loadRecords = function()
print('Loading DNS records for: ' .. domainName)
local response = fetch('gurt://localhost:8877/domain/' .. domainName .. '/records', {
local response = fetch('gurt://dns.web/domain/' .. domainName .. '/records', {
headers = {
Authorization = 'Bearer ' .. authToken
}
@@ -175,7 +175,7 @@ end
local function loadDomain()
print('Loading domain details for: ' .. domainName)
local response = fetch('gurt://localhost:8877/domain/' .. domainName, {
local response = fetch('gurt://dns.web/domain/' .. domainName, {
headers = {
Authorization = 'Bearer ' .. authToken
}
@@ -197,7 +197,7 @@ local function checkAuth()
if authToken then
print('Found auth token, checking validity...')
local response = fetch('gurt://localhost:8877/auth/me', {
local response = fetch('gurt://dns.web/auth/me', {
headers = {
Authorization = 'Bearer ' .. authToken
}
@@ -228,7 +228,7 @@ end
local function addRecord(type, name, value, ttl)
hideError('record-error')
local response = fetch('gurt://localhost:8877/domain/' .. domainName .. '/records', {
local response = fetch('gurt://dns.web/domain/' .. domainName .. '/records', {
method = 'POST',
headers = {
['Content-Type'] = 'application/json',

View File

@@ -75,7 +75,7 @@ end
local function loadTLDs()
print('Loading available TLDs...')
local response = fetch('gurt://localhost:8877/tlds')
local response = fetch('gurt://dns.web/tlds')
if response:ok() then
tlds = response:json()
@@ -91,7 +91,7 @@ local function checkAuth()
if authToken then
print('Found auth token, checking validity...')
local response = fetch('gurt://localhost:8877/auth/me', {
local response = fetch('gurt://dns.web/auth/me', {
headers = {
Authorization = 'Bearer ' .. authToken
}
@@ -127,7 +127,7 @@ local function submitDomain(name, tld)
hideError('domain-error')
print('Submitting domain: ' .. name .. '.' .. tld)
local response = fetch('gurt://localhost:8877/domain', {
local response = fetch('gurt://dns.web/domain', {
method = 'POST',
headers = {
['Content-Type'] = 'application/json',
@@ -157,7 +157,7 @@ end
local function createInvite()
print('Creating invite code...')
local response = fetch('gurt://localhost:8877/auth/invite', {
local response = fetch('gurt://dns.web/auth/invite', {
method = 'POST',
headers = {
Authorization = 'Bearer ' .. authToken
@@ -184,7 +184,7 @@ local function redeemInvite(code)
hideError('redeem-error')
print('Redeeming invite code: ' .. code)
local response = fetch('gurt://localhost:8877/auth/redeem-invite', {
local response = fetch('gurt://dns.web/auth/redeem-invite', {
method = 'POST',
headers = {
['Content-Type'] = 'application/json',

View File

@@ -21,7 +21,7 @@ submitBtn:on('submit', function(event)
password = password
})
print(request_body)
local url = 'gurt://localhost:8877/auth/login'
local url = 'gurt://dns.web/auth/login'
local headers = {
['Content-Type'] = 'application/json'
}