Skip to content

Getting Started

lyc8503 edited this page Oct 17, 2023 · 7 revisions

Prerequisites

  • a GitHub account
  • a Cloudflare account (free plan is enough for this usage)
  • 15 minutes of time
  • [Optional] a domain if you want to use custom domain (via CNAME)

Steps

  1. Fork this repo to your own account. (Maybe btw give it a star before forking? :3)

    fork

    You can leave all the options as default, change the repo name if you want.

    options
  2. Edit config/site.config.js and modify the options to your need. TODO: doc

  3. Login into your cloudflare, navigate to Workers & Pages - Overview and create a new application.

    cloudflare

    Choose Pages and click on Connect to Git button.

    pages

    Connect your GitHub account to Cloudflare via OAuth and grant permissions on your forked repo. Choose your forked repo to continue.

    git

    Choose Next.js framework preset and leave other options as default, click on Save and Deploy.

    git

    Wait for the building process to finish, should finish in ~2min. Then click on Continue to project.

    git

    Now visiting the domain provided by Cloudflare (xxx.pages.dev) should return something like Error: Could not access built-in Node.js modules. Please make sure that your Cloudflare Pages project has the 'nodejs_compat' compatibility flag set.

    So let's continue to do that.

  4. Change settings and bind KV storage

Clone this wiki locally