help with errors and environment setup

This commit is contained in:
simon 2022-04-23 00:41:50 +07:00
parent 2462eb9686
commit 7b5903c12c
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
1 changed files with 12 additions and 0 deletions

View File

@ -1,5 +1,12 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
## Setup your environment
- Clone the `feat/react-frontend` branch, base folder of the frontend is in `tubearchivist/www`
- Copy *.env.local.example* to *.env.local* and set:
- **NEXTAUTH_SECRET**: Some long random string
- **NEXTAUTH_URL**: Your frontend, most likely `http://localhost:3000`
- **NEXT_PUBLIC_TUBEARCHIVIST_URL**: Your Tube Archivist backend testing server, e.g. `http://localhost:8000`
## Getting Started
First, run the development server:
@ -10,6 +17,11 @@ npm run dev
yarn dev
```
### Errors:
- *next command not found*: Install next with `npm install next`
- *Error: Invalid src prop [...] hostname [...] is not configured under images in your `next.config.js`*: Add the *NEXT_PUBLIC_TUBEARCHIVIST_URL* to the list of *domains*.
- *CORS errors in console*: In your backend in `tubearchivist/config/settings.py` replace the line containing *CORS_ALLOWED_ORIGIN_REGEXES* with `CORS_ORIGIN_ALLOW_ALL = True` and rebuild the container. NEVER do that on network accessible installation.
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.