Giter Club home page Giter Club logo

aws-notion-site's Introduction

AWS Notion Site

Deploy your Notion Site on AWS, with Serverless Technology.

How it works

It uses AWS Lambda to proxy requests and inject necessary scripts to power the site, and the API Gateway runs behind CloudFront CDN, and it sets up both the apex domain and the www domain so all you have to do is to link the DNS to the CloudFront Distribution. The core mechanics is heavily inspired by Fruition.

How to use

First, copy .env.example to .env and fill in the environment variables based on the comments.

Then update the edge.js to set up the configuration section, the configuration code should be the same as Fruition.

At the end, just run the following command to deploy:

yarn
yarn deploy

Why use AWS Lambda?

We are trying to deploy our Notion site, but we couldn't get it to link to our domain since it is not using Cloudflare, and when I tried to set up CloudFront in front of the Cloudflare workers (by setting up a CNAME to the Cloudflare domain that has the Fruition site), the Cloudflare worker routing has issues. So I had to improvise with Lambdas by mimicking the same logic.

Why not use Lambda@Edge?

I actually have tried, and it would have worked well until the size of the response is larger than 1MB, which is the response size limit for Lambda@Edge. I wish we can eventually use edge lambdas because the performance would be better.

License

MIT

aws-notion-site's People

Contributors

lhr0909 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.