Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(platforms): Cloudflare Workers How-to #1616

Merged
merged 10 commits into from
Jul 10, 2023

Conversation

kamranayub
Copy link
Contributor

@kamranayub kamranayub commented Mar 7, 2023

The RavenDB Node.js client is getting support that enables it to work on Cloudflare and I have a Workers template that makes it easy to get started with Workers + RavenDB integration. This is a how-to guide to get up and running with it.

This is still in draft with unfinished pieces and I'll continue to revise it.

Tasks

  • Final draft
  • Add screenshots

Post-Publish / Follow-up

Questions

  • Where should this live? After talking with @ppekrol, I put it under Getting Started => Guides for now. There will be 2 other guides for Azure Functions (TypeScript/.NET) and AWS Lambda (.NET).

@kamranayub kamranayub marked this pull request as ready for review June 28, 2023 15:06

{NOTE/}

In this guide, you will learn how deploy a Cloudflare Worker using the [RavenDB Cloudflare Worker template][template] that is connected to your RavenDB database. This guide assumes you are familiar with Node.js development techniques and the basics of Cloudflare Workers.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

learn how deploy --> learn how to deploy


For a walkthrough and demo of getting started with Cloudflare Workers, see [TBD](#). -->

{NOTE/}
Copy link
Contributor

@reebhub reebhub Jul 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please include the table of contents in the note


In this guide, you will learn how deploy a Cloudflare Worker using the [RavenDB Cloudflare Worker template][template] that is connected to your RavenDB database. This guide assumes you are familiar with Node.js development techniques and the basics of Cloudflare Workers.

* [Before We Get Started](#before-we-get-started)
Copy link
Contributor

@reebhub reebhub Jul 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the TOC please use an "In this page" title & indent the contents, and use full URLs
e.g. -

Title
---

{NOTE: }
Description 

* In this page:
    * [Before We Get Started](../../start/guides/cloudflare-workers/overview#before-we-get-started)
    * [Create a Worker](../../start/guides/cloudflare-workers/overview#create-a-worker)
    * ...
   
{NOTE/}

{PANEL: Before We Get Started}

- A [RavenDB Cloud][cloud-signup] account or self-hosted client certificate
- A free or paid [Cloudflare account](https://cloudflare.com)
- [Git](https://git-scm.org)
- [Node.js](https://nodejs.com) 16+ with npm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this what nodejs.com normally shows?
image


### Obtain RavenDB certificate

First, download your RavenDB client certificate package you will use to authenticate. Follow the guides for either [Cloud certificates][docs-cloud-certs] or for [self-hosted certificates][docs-on-prem-certs]. It is recommended to [generate a new client certificate][docs-generate-client-certificate] with limited access rights instead of a `ClusterAdmin`-level certificate. This also ensures the Worker is using a dedicated certificate that can be managed separately.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

download your RavenDB... --> download the RavenDB...
"guides for either [Cloud certificates][docs-cloud-certs] or for" --> remove the "for" in the end

[gh-workflows]: https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions
[gh-workflows-manual]: https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
[gh-template-repo]: https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-template-repository
[image-template-deploy-cloudflare]: images/template-deploy-cloudflare.jpg
Copy link
Contributor

@reebhub reebhub Jul 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • this list of references works properly in our private documentation environment but i don't know if our site supports it. we usually embed links in the text - [like this](../../location)
    and the area after the text is kept for related articles.
  • regarding images: we usually add image titles, e.g. -
    [image-template-deploy-cloudflare](images/template-deploy-cloudflare.jpg "Deploy to Workers")
    or if adding it to the end of the text does work -
    [image-template-deploy-cloudflare]: images/template-deploy-cloudflare.jpg "Deploy to Workers"

- `DB_URLS` -- These are the node URLs for your RavenDB instance (Cloud or self-hosted). The values are comma-separated
- `DB_NAME` -- This is the default database to connect to

When left blank, the Live Test connection settings are used. The defaults are under `[vars]` and overriden in `[env.production.vars]`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overridden

Copy link
Contributor

@reebhub reebhub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be merged, my comments are minor & can be handled later on

@ppekrol ppekrol merged commit adbb501 into ravendb:master Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants