fraudTech commited on
Commit
33cd8ab
·
1 Parent(s): b31126c

Fix API endpoints - add /api prefix to match gateway routes

Browse files
Files changed (2) hide show
  1. web/src/App.tsx +2 -2
  2. web/src/Login.tsx +1 -1
web/src/App.tsx CHANGED
@@ -104,7 +104,7 @@ function App() {
104
  const verifyToken = async () => {
105
  if (token) {
106
  try {
107
- const response = await fetch(`${GATEWAY_URL}/auth/verify`, {
108
  headers: {
109
  'Authorization': `Bearer ${token}`
110
  }
@@ -168,7 +168,7 @@ function App() {
168
  setMessages((prev) => [...prev, assistantMessage]);
169
 
170
  try {
171
- const response = await fetch(`${GATEWAY_URL}/chat`, {
172
  method: 'POST',
173
  headers: {
174
  'Content-Type': 'application/json',
 
104
  const verifyToken = async () => {
105
  if (token) {
106
  try {
107
+ const response = await fetch(`${GATEWAY_URL}/api/auth/verify`, {
108
  headers: {
109
  'Authorization': `Bearer ${token}`
110
  }
 
168
  setMessages((prev) => [...prev, assistantMessage]);
169
 
170
  try {
171
+ const response = await fetch(`${GATEWAY_URL}/api/chat`, {
172
  method: 'POST',
173
  headers: {
174
  'Content-Type': 'application/json',
web/src/Login.tsx CHANGED
@@ -21,7 +21,7 @@ const Login: React.FC<LoginProps> = ({ onLogin }) => {
21
  setLoading(true);
22
 
23
  try {
24
- const endpoint = isRegistering ? '/auth/register' : '/auth/login';
25
  const body = isRegistering
26
  ? { username, password, name }
27
  : { username, password };
 
21
  setLoading(true);
22
 
23
  try {
24
+ const endpoint = isRegistering ? '/api/auth/register' : '/api/auth/login';
25
  const body = isRegistering
26
  ? { username, password, name }
27
  : { username, password };