splitbee / notion-api-worker

Notion as CMS with easy API access
MIT License
1.54k stars 197 forks source link

Could you please give more detail about how to host my own application for private Notion pages? #32

Open LeeJunHyun opened 3 years ago

LeeJunHyun commented 3 years ago

Thanks for sharing this nice work and react-notion as well.

I'm trying to host it using Cloudflare, but it is a little bit difficult for me because I don't have an experience with it.

Could you please give me some information about how to host it?

Harshmakadia commented 3 years ago

@LeeJunHyun Any update on this? You managed to make it work? Even I'm looking for the same

transitive-bullshit commented 3 years ago

@Harshmakadia check out https://www.npmjs.com/package/react-notion-x and https://github.com/transitive-bullshit/nextjs-notion-starter-kit which should make what you're looking for a lot easier.

huuphongsan commented 3 years ago

@LeeJunHyun Any update on this? You managed to make it work? Even I'm looking for the same

  1. Download / Clone / or Folk this repo to your computer.
  2. Run npm i @cloudflare/wrangler -g or sudo npm i @cloudflare/wrangler -g
  3. Run wrangler config. This is will ask you the Cloudflare API Token. Come to your Cloudflare API Token Page (https://dash.cloudflare.com/profile/api-tokens) and create token (only with Workers). Copy it and paste to your terminal, Enter.
  4. Go to file wrangler.example.toml and rename to wrangler.toml
  5. Also in wrangler.toml, you need to add value for account_id and zone_id (2 things you can find in your domain on Cloudflare). Add value for route (subdomain you want to use, example: sub.sample.com). And also remove the line workers_dev = true because this line will send you an error like this [you must set workers_dev = true OR provide a zone_id and route/routes.]
  6. After edit wrangler.toml, open your terminal in the same folder, run wrangler publish. And it will run to push your files to Cloudflare Workers.
  7. Go to your Cloudflare, Domain you have choosen (the domain you use account_id and zone_id. Create A with value is sub (subdomain you use) and point to 1.1.1.1 with Cloudflare Gates (Orange Cloud).
  8. Enjoy it.
huuphongsan commented 3 years ago

Thanks for sharing this nice work and react-notion as well.

I'm trying to host it using Cloudflare, but it is a little bit difficult for me because I don't have an experience with it.

Could you please give me some information about how to host it?

CC you as well. Thank you.