diff --git a/README.md b/README.md index a064329..cf7b6b0 100644 --- a/README.md +++ b/README.md @@ -9,16 +9,19 @@ - and then `apt update && apt install docker-ce` - Install Docker-compose - `pip3 install docker-compose` -- Inside your Yunohost LXC/ynh-dev/???, make sure the new `yunohost-portal-api` is running and corresponding route is in nginx config -- Add something like `NUXT_PUBLIC_API_IP=yolo.test` inside a `.env` which you may need to create. Replace `yolo.test` with you test domain or test IP (eg your ynh-dev LXC) +- Inside your Yunohost LXC/ynh-dev/???, make sure the new `yunohost-portal-api` service is running and corresponding route is in nginx config +- **Important**: Inside your Yunohost machine, enable CORS from your dev front-end: + - `echo "http://127.0.0.1:3000" > /etc/yunohost/.portal-api-allowed-cors-origins` + - `systemctl restart yunohost-portal-api` +- Back to Yunohost-portal's repo: define what's the IP / domain of your test LXC where the API lives (here, for example, `yolo.test` which is define in `/etc/hosts`): + - `echo 'NUXT_PUBLIC_API_IP=yolo.test' > .env` - `docker-compose up -d` : will rebuild the docker on the first time, then launch it - Check `docker-compose logs -f` : should show that nuxt/nitro is building stuff then serving it on port 3000 -- Access `127.0.0.1:3000` from your browser +- Access `http://127.0.0.1:3000` from your browser ### Develop (manual / directly on your host machine) -- Same as for Docker, this assumes that `yunohost-portal-api` does run, is configured in nginx, and you may have to set `NUXT_PUBLIC_API_IP` in `.env` which you may have to create -- You'll need NodeJS 18.14 (or higher) -- And `yarn` +- Basically the same stuff, but ignore docker-related steps. Instead: +- You'll need NodeJS 18.14 (or higher) and `yarn` - Run `yarn install` - Run `yarn dev`