
{article.title}
+écrit par {article.author} le {new Date(article.publishedAt).toLocaleDateString()} (Dernière modification le : {new Date(article.editedAt || article.publishedAt).toLocaleDateString()})
++
{article.content}
+diff --git a/back/src/main.rs b/back/src/main.rs index ad8f7f5..7242d32 100644 --- a/back/src/main.rs +++ b/back/src/main.rs @@ -74,7 +74,7 @@ async fn main() -> Result<(), std::io::Error> { .service(api) .service(Files::new("/", "public").index_file("index.html")) }) - .bind(("0.0.0.0", 8080))? + .bind(("0.0.0.0", 2486))? .run() .await } diff --git a/docker-compose.yml b/docker-compose.yml index 1e0df8d..9bcaab9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: container_name: web restart: always ports: - - 8080:8080 + - 8080:2486 volumes: - ./back/data:/app/data diff --git a/dockerfile b/dockerfile index d8e8f78..f092a14 100644 --- a/dockerfile +++ b/dockerfile @@ -10,9 +10,9 @@ RUN cargo build --release FROM debian:bookworm-slim WORKDIR /app -RUN apt-get update & apt-get install -y extra-runtime-dependencies & rm -rf /var/lib/apt/lists/* +RUN apt update && apt install -y libsqlite3-0 COPY --from=front /app/dist /app/public COPY --from=back /app/target/release/back /app/back -EXPOSE 8080 +EXPOSE 2486 CMD ["/app/back"] diff --git a/front/package.json b/front/package.json index 8bd44d7..e1132b0 100644 --- a/front/package.json +++ b/front/package.json @@ -12,7 +12,8 @@ "dependencies": { "react": "^18.3.1", "react-dom": "^18.3.1", - "react-router": "^7.0.2" + "react-router": "^7.0.2", + "react-router-dom": "^6.2.1" }, "devDependencies": { "@eslint/js": "^9.15.0", @@ -25,6 +26,7 @@ "globals": "^15.12.0", "typescript": "~5.6.2", "typescript-eslint": "^8.15.0", - "vite": "^6.0.1" + "vite": "^6.0.1", + "react-router-dom": "^6.2.1" } } diff --git a/front/public/pictures/sea.gif b/front/public/pictures/sea.gif new file mode 100644 index 0000000..78a4617 Binary files /dev/null and b/front/public/pictures/sea.gif differ diff --git a/front/src/components/ArticleCard.tsx b/front/src/components/ArticleCard.tsx new file mode 100644 index 0000000..6a02bb3 --- /dev/null +++ b/front/src/components/ArticleCard.tsx @@ -0,0 +1,49 @@ +import { ArticlePreview } from '../types' +import ButtonLink from './ButtonLink' + +export default function ArticleCard({ articlePreview }: { articlePreview: ArticlePreview }) { + return ( +
{articlePreview.preview}
+No articles found
} + {loading &&Loading...
} + {error &&{error}
} +écrit par {article.author} le {new Date(article.publishedAt).toLocaleDateString()} (Dernière modification le : {new Date(article.editedAt || article.publishedAt).toLocaleDateString()})
+{article.content}
+