wasmerio / wasmer.io

The Wasmer.io website
https://wasmer.io/
21 stars 17 forks source link

Run in Cloudflare Workers #72

Open syrusakbary opened 1 year ago

syrusakbary commented 1 year ago

Run this website (with outstatic) with Cloudflare Workers (probably we'll need to use the experimental edge config flag from next.js).

To use the experimental edge locally, you would need to have a next.config.js similar to:

const withReactSvg = require('next-react-svg');
const path = require('path');

module.exports = withReactSvg({
  include: path.resolve(__dirname, 'public/images'),
  webpack(config, options) {
    return config;
  },
  experimental: {
    runtime: 'experimental-edge',
  },
  env: {
    GITHUB_API_ACTIVE: process.env.GITHUB_API_ACTIVE ? process.env.GITHUB_API_ACTIVE : false,
  }
});

Extra info: https://developers.cloudflare.com/pages/framework-guides/deploy-a-nextjs-site/

syrusakbary commented 1 year ago

Objective: have the website hosted in cloudflare pages (can be in any subdomain, doesn't need to be in wasmer.io), with outstatic running properly on it