autobrr/web
KaiserBh 4432dfb099
feat(http): implement proper BaseUrl support to coexist with legacy mode (#1298)
* refactor: remove baseUrl from api calls and sseBaseUrl

* refactor: set cookie session to '/'.

Since that's where the api endpoint is that way we set it to the root domain, we can't set it to the subfolder since the api is called directly now and not using the baseUrl.

* feat: add the baseUrl route.

When user for example is in `/autobrr` and hit reload it should just return the index.html.

* refactor: now it have to be `/autobrr`

Remove the trailing `/`, now base url is set to /autobrr aligned with other arrs.

* refactor: remove baseUrl stuff.

* refactor: use separate router for the api endpoint and the baseUrl.

I don't think we need separate router, but I didn't test it, so feel free to test it and see if it works without the separate router, the whole point was to make sure that it's not prefixed with baseUrl and I noticed that it was being called in the frontend `APIClients.ts`. So yea just check if it works without it then keep the old one.

Also removed the index since it was zombie code not being used anywhere.

* feat: Dynamic base url.

* fix: auth handler deps

* feat(http): mount web and api on baseurl

* feat(http): web api client routes

* feat(http): baseurl legacy mode

* feat(http): baseurl legacy mode test

* feat(http): add assetBaseUrl

* feat(http): try separate web handlers

* feat(http): improve file serving

* feat(http): ignore .gitkeep

* fix(assets): windows paths

* fix(assets): windows paths trimprefix

* fix(assets): windows paths join

* fix(assets): cleanup

* fix(assets): additional web route check

* feat(http): add comments

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2024-12-19 12:56:04 +01:00
..
dist refactor(web): migrate create-react-app to vite (#823) 2023-04-10 14:28:24 +02:00
public fix(web): Inter font (#1133) 2023-09-22 18:37:56 +02:00
src feat(http): implement proper BaseUrl support to coexist with legacy mode (#1298) 2024-12-19 12:56:04 +01:00
.eslintrc.cjs build(web): bump vite and cjs node api refactor (#1276) 2023-12-15 23:36:16 +01:00
.gitignore refactor(web): migrate create-react-app to vite (#823) 2023-04-10 14:28:24 +02:00
.npmrc fix(web): disable pnpm strict version check (#1519) 2024-04-22 19:51:24 +02:00
build.go feat(http): implement proper BaseUrl support to coexist with legacy mode (#1298) 2024-12-19 12:56:04 +01:00
index.html feat(http): implement proper BaseUrl support to coexist with legacy mode (#1298) 2024-12-19 12:56:04 +01:00
package.json feat(web): migrate react-table to v8 (#1866) 2024-12-08 16:50:01 +01:00
pnpm-lock.yaml feat(web): migrate react-table to v8 (#1866) 2024-12-08 16:50:01 +01:00
postcss.config.cjs build(web): bump vite and cjs node api refactor (#1276) 2023-12-15 23:36:16 +01:00
README.md build(web): bump vite and cjs node api refactor (#1276) 2023-12-15 23:36:16 +01:00
tailwind.config.ts build(web): bump vite and cjs node api refactor (#1276) 2023-12-15 23:36:16 +01:00
tsconfig.json build(web): bump vite and cjs node api refactor (#1276) 2023-12-15 23:36:16 +01:00
tsconfig.node.json build(web): bump vite and cjs node api refactor (#1276) 2023-12-15 23:36:16 +01:00
vite.config.ts feat(http): implement proper BaseUrl support to coexist with legacy mode (#1298) 2024-12-19 12:56:04 +01:00

web

This project uses React built with Vite.

Available Scripts

In the project directory, you can run:

pnpm dev

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

pnpm run build

Builds the app for production to the dist folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

Learn More

To learn React, check out the React documentation.