Skip to content

Commit

Permalink
Adding a proposed solution for lab 9
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaMannella committed May 29, 2024
1 parent ff8a70d commit ab94726
Show file tree
Hide file tree
Showing 29 changed files with 8,116 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ Laboratories solutions (under development) for the course of _Web Applications I
- Lab 07: [React Forms](https://github.com/polito-webapp1/lab-2024/tree/main/lab07-forms)
- Lab 08: [Multiple Pages in React](https://github.com/polito-webapp1/lab-2024/tree/main/lab08-routes)
- Lab 09: [API Integration (part 1)](https://github.com/polito-webapp1/lab-2024/tree/main/lab09-client-server-I)
- Lab 10: API Integration (part 2)
- Lab 10: [API Integration (part 2)](https://github.com/polito-webapp1/lab-2024/tree/main/lab09-client-server-II)
- Lab 11: Authentication
12 changes: 12 additions & 0 deletions lab09-client-server-I/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Lab 09: APIs Integration (part I)

The files in this folder are structured as follows:

- server: contains the server-side code, based on the solution of lab 3;
- client: contains the updated client-side code for this lab, based on the solution of lab 8.

In this version of the application:

- The cors package is added to the server to allow requests from the client.
- The full list of movies is retrieved from the server when the page is loaded.
- Every time a filter is applied (including "All"), the filtered list of movies is retrieved from the server.
21 changes: 21 additions & 0 deletions lab09-client-server-I/solution/client/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
settings: { react: { version: '18.2' } },
plugins: ['react-refresh'],
rules: {
'react/jsx-no-target-blank': 'off',
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
13 changes: 13 additions & 0 deletions lab09-client-server-I/solution/client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<link rel="icon" type="image/svg+xml" href="/favicon.ico"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Film Library</title>
</head>
<body>
<div id="root" class="w-100"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
Loading

0 comments on commit ab94726

Please sign in to comment.