Skip to content

fix: expose with the /api prefix#2037

Merged
spaenleh merged 24 commits into
mainfrom
single-origin
Nov 28, 2025
Merged

fix: expose with the /api prefix#2037
spaenleh merged 24 commits into
mainfrom
single-origin

Conversation

@spaenleh

Copy link
Copy Markdown
Member

In this PR:

  • expose routes under the /api prefix
    • only the /health route stays at the root
  • add a nginx container that appends /api prefix before forwarding requests to the core container

I made the following changes:

The "legacy" server is accessible at localhost:3000 where the nginx forwards requests. Use paths without /api if using this. This mimicks the api.graasp.org behaviour.

A new localhost:3001 that is the core container directly. Here you need to use paths with the /api prefix. This is designed to be used as the target for single origin and as a target for the vite server proxy.

Example usage:

http://localhost:3000/items/:id -> via nginx proxy
http://localhost:3001/api/items/:id -> direct to backend

@pyphilia pyphilia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huge PR! A step towards ESM ;)

Comment thread src/services/item/plugins/folder/folder.service.spec.ts
Comment thread src/services/item/plugins/folder/folder.service.spec.ts
Comment thread src/services/item/plugins/recycled/recycled.ws.test.ts
@sonarqubecloud

Copy link
Copy Markdown

@spaenleh spaenleh merged commit dd56268 into main Nov 28, 2025
10 checks passed
@spaenleh spaenleh deleted the single-origin branch November 28, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants