S
SolidJS11mo ago
dmayo2

direct link?

Hello. Is it possible to directly link to a page? If not, any suggestions? This is my App.jsx page. It is an app that is behind a login. If no session it goes to the login, if it's a nonexistent page it goes to a custom 404. It's hosted on Netlify. It worked locally. Any ideas/thoughts/suggestions? Thanks.
No description
13 Replies
bigmistqke
bigmistqke11mo ago
I don't really understand the question. What isn't working w your setup?
dmayo2
dmayo211mo ago
If I type in my browser: https://site.com/public -- the public page doesn't load. Just the default Netlify 404.
bigmistqke
bigmistqke11mo ago
did u use the netlify adapter?
bigmistqke
bigmistqke11mo ago
SolidStart Beta Documentation
SolidStart Beta Documentation
Early release documentation and resources for SolidStart Beta
dmayo2
dmayo211mo ago
No, I haven't touched anything in solid-start
bigmistqke
bigmistqke11mo ago
cool, then that's most likely the issue just npm the solid-start-netlify and add it to your vite.config like the link i sent u
dmayo2
dmayo211mo ago
Thanks. I'll give it at try. From the link, should I use Netlify functions & edge or Static Hosting
bigmistqke
bigmistqke11mo ago
Depends on if you are deploying on the edge or not
dmayo2
dmayo211mo ago
I don't believe I'm on the edge
bigmistqke
bigmistqke11mo ago
Then I would try first without that {edge: true} Just adapter: netlify() basically
dmayo2
dmayo211mo ago
I guess all sites are on the edge by default. still nothing.
Jules
Jules11mo ago
Can we take a look at your vite.config.ts? that would be helpful in diagnosing your issue, also any logs during the Netlify build process or http logs for the route you're trying to hit. In general though, @bigmistqke is trying to get you setup with the vite adapter for Netlify so that your build is done correctly and thus Netlify's servers will be looking in the place where your build is outputted. Here is an example config, and basically what yours should look like:
import solid from "solid-start/vite";
import { defineConfig } from "vite";
import netlify from "solid-start-netlify";

export default defineConfig(() => {
return {
plugins: [
solid({
ssr: true,
adapter: netlify({
edge: true,
}),
}),
],
};
});
import solid from "solid-start/vite";
import { defineConfig } from "vite";
import netlify from "solid-start-netlify";

export default defineConfig(() => {
return {
plugins: [
solid({
ssr: true,
adapter: netlify({
edge: true,
}),
}),
],
};
});
dmayo2
dmayo211mo ago
The answer is to have a netlify.toml file in the root with redirects:
[functions]
node_bundler = "esbuild"

## Uncomment to use this redirect for Single Page Applications like create-react-app.
## Not needed for static site generators.
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
[functions]
node_bundler = "esbuild"

## Uncomment to use this redirect for Single Page Applications like create-react-app.
## Not needed for static site generators.
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
Want results from more Discord servers?
Add your server