Add frontend pages with login, download, and announcements
All checks were successful
Client CI/CD / deploy (push) Successful in 12s
All checks were successful
Client CI/CD / deploy (push) Successful in 12s
- React Router v7: public home page, /login page - Auth context with JWT localStorage management - Login: ID/PW form + SSAFY login button (UI only) - Home: hero banner, download section (login required), announcement board - API layer with mock data (ready for Go Fiber backend) - Color scheme: #2E2C2F dark + #BACDB0 accent - Add .env.example for environment variable reference Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
15
src/api/client.js
Normal file
15
src/api/client.js
Normal file
@@ -0,0 +1,15 @@
|
||||
const BASE = import.meta.env.VITE_API_BASE_URL || '';
|
||||
|
||||
export async function apiFetch(path, options = {}) {
|
||||
const token = localStorage.getItem('token');
|
||||
const headers = { 'Content-Type': 'application/json', ...options.headers };
|
||||
if (token) headers['Authorization'] = `Bearer ${token}`;
|
||||
|
||||
const res = await fetch(BASE + path, { ...options, headers });
|
||||
if (!res.ok) {
|
||||
const err = new Error(res.statusText);
|
||||
err.status = res.status;
|
||||
throw err;
|
||||
}
|
||||
return res.json();
|
||||
}
|
||||
Reference in New Issue
Block a user