Loading...
;
+ }
+
+ if (error) {
+ return
-
Main Page
+ <>
+
+ >
)
}
\ No newline at end of file
diff --git a/front/src/types.ts b/front/src/types.ts
new file mode 100644
index 0000000..b86ff18
--- /dev/null
+++ b/front/src/types.ts
@@ -0,0 +1,13 @@
+interface Article {
+ id: number;
+ title: string;
+ content: string;
+}
+
+interface ArticlePreview {
+ id: number;
+ title: string;
+ preview: string;
+}
+
+export type { Article, ArticlePreview };
\ No newline at end of file
diff --git a/front/vite.config.ts b/front/vite.config.ts
index 8b0f57b..795d340 100644
--- a/front/vite.config.ts
+++ b/front/vite.config.ts
@@ -4,4 +4,28 @@ import react from '@vitejs/plugin-react'
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
+ server: {
+ proxy: {
+ '/api': {
+ target: 'http://127.0.0.1:2486',
+ changeOrigin: true,
+ secure: false,
+ ws: true,
+ /*
+ configure: (proxy, _options) => {
+ proxy.on('error', (err, _req, _res) => {
+ console.log('proxy error', err);
+ });
+ proxy.on('proxyReq', (proxyReq, req, _res) => {
+ console.log('Sending Request to the Target:', req.method, req.url);
+ });
+ proxy.on('proxyRes', (proxyRes, req, _res) => {
+ console.log('Received Response from the Target:', proxyRes.statusCode, req.url);
+ });
+ },
+ */
+ //rewrite: path => path.replace(/^\/api/, '')
+ }
+ }
+ },
})
diff --git a/package-lock.json b/package-lock.json
new file mode 100644
index 0000000..e73376c
--- /dev/null
+++ b/package-lock.json
@@ -0,0 +1,6 @@
+{
+ "name": "projet-nuitinfo-2024",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {}
+}