analogjs / analog

The fullstack meta-framework for Angular. Powered by Vite and Nitro
https://analogjs.org
MIT License
2.58k stars 247 forks source link

Add documentation around needed Netlify config for server features #1060

Closed RyanClementsHax closed 6 months ago

RyanClementsHax commented 6 months ago

Which scope/s are relevant/related to the feature request?

Docs

Information

Deploying a static analog application works just fine. Netlify infers the publish directory and build command just fine.

Example generated from npm create analog@latest: https://analog-project.netlify.app/ https://github.com/RyanClementsHax/analog-project Build settings: image


Deploying a server-full analog application runs into some issues. When deployed, the front end seems to have trouble connecting to the backend.

Example generated from npx create-nx-workspace@latest --preset=@analogjs/platform: https://analog-nx.netlify.app/ https://github.com/RyanClementsHax/analog-nx Build settings: image

# netlify.toml
[build]
  command = "nx build analog-app"
  publish = "dist/analog-app/client"
  functions = "dist/analog-app/analog/server"

Error: image

Deployed assets: deploy-662c2aa458585500082de2b6.zip


I'm sure I'm just missing a simple setting. I'd be happy to be the one to update the docs or generators as needed


Other issues consulted: https://github.com/analogjs/analog/issues/631 https://github.com/analogjs/analog/issues/492


Describe any alternatives/workarounds you're currently using

Haven't found the right config to get this to work yet.

I would be willing to submit a PR to fix this issue

brandonroberts commented 6 months ago

We have deployment docs here for Netlify

https://analogjs.org/docs/features/deployment/providers#netlify

Nx is a little different because of the output directory, but the setup is mostly the same

RyanClementsHax commented 6 months ago

Ah I see where I went wrong now. I tried that config before, but I think I messed up something. It is working for me now. Thanks for the help.

Mind if I add an example netlify.toml and some links to netlify's documentation that explain what the publish and functions directories are?

brandonroberts commented 6 months ago

Yep, that helps