Hi, I am trying to build JAMstack site with Angular and Scully. I followed all the possible @tzmanics tutorials (awesome articles) but I can not manage to make everything work.
I have made simple login view which calls to Netlify Functions to obtain a title - works without issues (HttpClient GET /api/title). Whenever I am running scully
it pauses on /login route for about 25 seconds, which I believe is a timeout caused by unavailable API. In result my rendered index.html for login route has no prerendered title. I have no clue how to run it so it fetches all the data. Same thing happens on my builds with the command:
"jam-prod": "ng build -c production && npm run scully -- --nw --scanRoutes",
My desired goal is to see live prerendered site and use ntl dev
locally to preview prerendered JAMstack app.
Thanks for your time!
My netlify.toml
configuration:
[build]
base = "./"
publish = "./dist/static"
functions = "./functions"
command = "npm run jam"
[context.production]
command = "npm run jam-prod"
[context.production.environment]
FAUNADB_SERVER_SECRET = "fn...pM"
[context.branch-deploy]
command = "npm run jam-dev"
[context.branch-deploy.environment]
FAUNADB_SERVER_SECRET = "ef...Md"
[[headers]]
for = "/*"
[headers.values]
Access-Control-Allow-Credentials = "true"
Access-Control-Allow-Headers = "Access-Control-Allow-Headers, Origin,Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers"
Access-Control-Allow-Methods = "GET,HEAD,OPTIONS,POST,PUT"
Access-Control-Allow-Origin = "*"
[[redirects]]
from = "/api/*"
to = "http://localhost:34567/:splat"
status = 200
Tools:
Angular CLI: 10.0.0
Netlify CLI: 2.43.0
Scully: 0.0.98