{"repo":"davidnx/NextjsStaticHosting-AspNetCore","free":true,"listed":false,"github":"https://github.com/davidnx/NextjsStaticHosting-AspNetCore","clone":"git clone https://github.com/davidnx/NextjsStaticHosting-AspNetCore.git","description":"Next.js apps on ASP .NET Core without Node.js","language":"C#","stars":176,"topics":["aspnetcore","nextjs","nodejs"],"license":"MIT","category":"saas-starters-boilerplates","readme_excerpt":"Host a statically-exported Next.js client-side application on ASP .NET Core with full support for SSG apps, including Dynamic Routes (see Next.js: Server-side Rendering vs. Static Generation). This is an ideal and scalable option for large scale production deployments of Next.js apps without requiring Node.js on the server. See the blog post Usage Option 1: Running the sample with your own Next.js app 1. Export your Next.js app using npx next export 2. Copy the generated outputs from out to .\\samples\\PreBuiltClientDemo\\ClientApp 3. Run samples\\PreBuiltClientDemo and see it working at https://locahost:5001 . Option 2: Adding NextjsStaticHosting to an existing ASP .NET Core project (minimal API's) Modify your Program.cs as follows: Option 3: Adding NextjsStaticHosting to an existing ASP .NET Core project (traditional startup style API's) Add the following to your Startup.cs : Why ASP .NET Core Next.js applications are usually hosted on a Node.js server which, among other things, takes care of routing concerns and serves the appropriate files for each incoming request. While this is a fine choice in many scenarios, there are use cases where it may be desirable to use a different stack such as ASP .NET Core (e.g. for scalability concerns or because an application's backend may already use ASP .NET Core, and setting up a separate infra to host the client app may be challenging and / or costly). One may think that pure static hosting is possible thanks to Next.js' support for Stati","default_branch":null,"files":null,"tree":[],"storefront":"/r/davidnx","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/davidnx/NextjsStaticHosting-AspNetCore/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}