From 7b5903c12cb4ae6f4b1a3a65782348cf68c2f61d Mon Sep 17 00:00:00 2001 From: simon Date: Sat, 23 Apr 2022 00:41:50 +0700 Subject: [PATCH] help with errors and environment setup --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index c87e042..4235158 100644 --- a/README.md +++ b/README.md @@ -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.