Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature?]: Client rewrite of host to enable client and server deployments to different hosts (e.g. s3 for the client, ec2 for the server) #1662

Closed
2 tasks done
greglearns opened this issue Oct 26, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@greglearns
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Summary 💡

I'd like to serve the client code via S3/Cloudfront at www.example.com, and host the server code on an EC2 instance at api.example.com. Is that possible? We'd need to rewrite the client host for all API calls (and tRPC as well, but that's a different issue).

Examples 🌈

No response

Motivation 🔦

Serving the static assets via S3 would be nice, leaving the EC2 instance to only have to handle API requests instead of having to serve static assets.

@greglearns greglearns added the enhancement New feature or request label Oct 26, 2024
@greglearns
Copy link
Author

SOLUTION:
This is not related to SolidStart at all. Instead, set the URL using whatever request method you are currently using.

For example, if you are using:

export const api = createTRPCClient<AppRouter>({
  links: [
    // identifies what url will handle trpc requests
    httpBatchLink({ url: `${getBaseUrl()}/api/trpc` }),
  ],
});

Closing this issue. Hopefully it will help someone who sees this in the future. Have a great day, from the past!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant