Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions t20-project-2/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# React + TypeScript + Vite

## GraphQL connection

The city explorer uses the Apollo API at `http://it2810-20.idi.ntnu.no:3001/` through a same-origin `/api/graphql` route. The Vite development server proxies that route to Apollo, so the browser does not need direct cross-origin access.

Install and start this project from its folder with:

```sh
pnpm --ignore-workspace install --frozen-lockfile
pnpm --ignore-workspace dev
```

The `--ignore-workspace` option is needed when this project is opened underneath a parent directory that has its own `pnpm-workspace.yaml`.

For production, configure the web server to proxy `/api/graphql` to the Apollo server and serve the site over HTTPS. Alternatively, set `VITE_GRAPHQL_URL` to an HTTPS GraphQL endpoint and configure CORS on Apollo to allow the site's origin. Do not expose the MongoDB connection string to the frontend. City search, filters, pagination, and reviews use the API; saved cities remain in the current browser because the API does not provide account or bookmark operations.

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:
Expand Down
Loading