#Static site generation

14 messages · Page 1 of 1 (latest)

whole night
#

I have a page not dynamic params page just a page that calls an api and render the data response how ever it is only required in development on production i just want static side and make the page static on build step (on build step call the api and build static site with the data)

inner lotusBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

turbid sapphire
#

The route should be statically generated by default unless you use dynamic function(s).

You can also statically export your site if you want a completely static site. This does come with some repercussions however:
https://nextjs.org/docs/app/building-your-application/deploying/static-exports#unsupported-features

Next.js enables starting as a static site or Single-Page Application (SPA), then later optionally upgrading to use features that require a server.

whole night
#

i want middleware to work if any one type wrong url i want to redirect in this case that will not work

whole night
#

for example i have a array [1, 2, 3]
I'm prerendering them as
/[number]/page.tsx this page is statically generated on build time

also i have a side nav where I'm showing the available /[number] pages so user can navigate. form my nav component I'm fetching the [number] array form my server but the thing is my pages are prepared so i know they will never change without new build so it will be helpful for me if i can make nav component prerender (statically generated)

then here's come next point when someone try to access my website index page there is no index page so I'm rewrite the request to send user to one of the [number] page so that's why I want middleware to work, also there is auto url heal feature when someone type one of the [number] page url but not correct url the url direct them to correct page

turbid sapphire
whole night
#

let me try

whole night
#

not working

#

it causes infinite loop some how my middleware always get the / index path in throw im requstuing /dua?cat=1 page

#

dont make any sense but it's happeing