Skip to content

Latest commit

 

History

History
35 lines (20 loc) · 996 Bytes

File metadata and controls

35 lines (20 loc) · 996 Bytes

Deploying the Ecommerce Solution

There are two things you need to do before you deploy your store using your favorite hosting platforms (e.g Netlify, Vercel, GitHub Pages, Cloudflare Pages, etc.):

  1. Set all the environment variables in the deployment service you'll use to run the build.

  2. Decide if you want to go with static site generation (SSG) or server-side rendering (SSR).

SSG

  1. Add this in addition to other variables in your env:
NEXT_PUBLIC_DATA_FETCHING=ssg
  1. Run npm run export to create a static optimized production build of your application.

  2. Copy the folder in demo-store-core/packages/website/out to your preferred static hosting.

SSR

  1. Add this in addition to other variables in your env:
NEXT_PUBLIC_DATA_FETCHING=ssr
  1. Set the output directory to demo-store-core/packages/website/.next.

  2. Run npm run build to create an optimized production build of your application.


<< previous lesson | next lesson >>