From 96b29a1b69531c08b959ed602fea7376f9372c53 Mon Sep 17 00:00:00 2001 From: josephroy99 Date: Mon, 18 Dec 2023 00:19:49 +0000 Subject: [PATCH] make post script work with external uri --- auth/post.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/auth/post.rb b/auth/post.rb index 55edadc..704b290 100644 --- a/auth/post.rb +++ b/auth/post.rb @@ -4,7 +4,7 @@ require 'uri' require 'json' # The URL you want to send the POST request to -url = URI.parse('http://localhost:4567/auth/login') +url = URI.parse('http://auth.roysathome.net/auth/login') # Create a new Net::HTTP object with the target server http = Net::HTTP.new(url.host, url.port) @@ -43,7 +43,7 @@ response_data = JSON.parse(response.body) reauthentication_token = response_data['token'] #while true - url = URI.parse('http://localhost:4567/auth/reauthenticate') + url = URI.parse('http://auth.roysathome.net/auth/reauthenticate') request = Net::HTTP::Post.new(url.path) request['Authorization'] = "Bearer #{reauthentication_token}" @@ -71,7 +71,7 @@ reauthentication_token = response_data['token'] file_content = File.read('./example.txt') # Create a URI object for the API endpoint -uri = URI.parse('http://localhost:4567/upload') +uri = URI.parse('http://auth.roysathome.net/upload') # Create a Net::HTTP object http = Net::HTTP.new(uri.host, uri.port)