From 6fe3bca6447858f3adf53d38ba6c799204f12e44 Mon Sep 17 00:00:00 2001 From: Jo Franchetti Date: Sun, 21 Apr 2024 18:27:34 +0100 Subject: [PATCH 01/14] updating subhosting documentation --- sidebars/subhosting.js | 46 +++++++- subhosting/manual/databases.md | 6 + subhosting/manual/deployments.md | 10 ++ subhosting/manual/domains.md | 19 ++- subhosting/manual/getting_started.md | 121 ------------------- subhosting/manual/index.md | 113 ++++++++---------- subhosting/manual/organizations.md | 13 +++ subhosting/manual/projects.md | 6 + subhosting/manual/quick_start.md | 169 +++++++++++++++++++++++++++ subhosting/manual/usecases.md | 18 +++ 10 files changed, 330 insertions(+), 191 deletions(-) create mode 100644 subhosting/manual/databases.md create mode 100644 subhosting/manual/deployments.md create mode 100644 subhosting/manual/organizations.md create mode 100644 subhosting/manual/projects.md create mode 100644 subhosting/manual/quick_start.md create mode 100644 subhosting/manual/usecases.md diff --git a/sidebars/subhosting.js b/sidebars/subhosting.js index 651e7fc55..af5bc1ef8 100644 --- a/sidebars/subhosting.js +++ b/sidebars/subhosting.js @@ -1,12 +1,52 @@ const sidebars = { - subhosting: [ + subhosting: [], + + subhostGuideHome: [ { type: "html", value: "
Getting Started
", className: "section-header", }, - "manual/index", - "manual/getting_started", + { + type: "doc", + label: "Quick Start", + id: "manual/quick_start", + }, + { + type: "doc", + label: "About Subhosting", + id: "manual/index", + }, + { + type: "doc", + label: "Subhosting Usecases", + id: "manual/usecases", + }, + { + type: "html", + value: "
Subhosting Platform
", + className: "section-header", + }, + { + type: "doc", + label: "Organizations", + id: "manual/organizations", + }, + { + type: "doc", + label: "Projects", + id: "manual/projects", + }, + { + type: "doc", + label: "Deployments", + id: "manual/deployments", + }, + { + type: "doc", + label: "Custom Domains", + id: "manual/domains", + }, "manual/projects_and_deployments", "manual/events", { diff --git a/subhosting/manual/databases.md b/subhosting/manual/databases.md new file mode 100644 index 000000000..52b32638e --- /dev/null +++ b/subhosting/manual/databases.md @@ -0,0 +1,6 @@ +# Connecting a Database + +A (KV) database stores key-value pairs +You can make a database accessible to a deployment when you make the deployment. +KV databases can be used by multiple deployments at the same time + diff --git a/subhosting/manual/deployments.md b/subhosting/manual/deployments.md new file mode 100644 index 000000000..d2b3e1ae7 --- /dev/null +++ b/subhosting/manual/deployments.md @@ -0,0 +1,10 @@ +- [**Deployments**](https://apidocs.deno.com/#get-/projects/-projectId-/deployments): + a deployment is a set of configuration, runnable code, and supporting static + files that can run on an isolate in Deno Deploy. Deployments have an entry + file that can launch a server, can have a [Deno KV](/deploy/kv/manual) + database associated with them, and can be set up to run on custom domains. + +Deployments A deployment is an immutable object that consists of: Source code to +run Static assets Environment variables Database bindings Other settings We +provide endpoints for Querying or streaming build logs Querying or streaming +execution logs diff --git a/subhosting/manual/domains.md b/subhosting/manual/domains.md index de1ad08d7..67d325176 100644 --- a/subhosting/manual/domains.md +++ b/subhosting/manual/domains.md @@ -1,6 +1,17 @@ -# Working with custom domains +# Custom domains -TODO - talk about provisioning domains and associating them with deployments. +[** Custom domains**](https://apidocs.deno.com/#get-/organizations/-organizationId-/domains) +can be dynamically mapped to deployments, giving them a unique URL (eg +`mycompany.com`). -For now, reference: -https://github.com/denoland/deploy-api/blob/main/samples.ipynb +Before a domain can be used you need to +[verify ownership and provision +or upload TLS certificates](https://github.com/denoland/deploy-api/blob/main/samples.ipynb). + +If you are on the [Builder tier](https://deno.com/deploy/pricing?subhosting) you +can use wildcard domains. Once you have a wildcard domain registered, you can +use it in two ways: + +- Send all requests for `*.mycompany.com` to a specific deployment +- (Coming soon) Assign different subdomains (e.g. `foo.mycompany.com` and + `bar.mycompany.com`) to separate deployments. diff --git a/subhosting/manual/getting_started.md b/subhosting/manual/getting_started.md index c4fc5a549..e69de29bb 100644 --- a/subhosting/manual/getting_started.md +++ b/subhosting/manual/getting_started.md @@ -1,121 +0,0 @@ -# Getting started with subhosting - -To get started with subhosting, you will need to create an organization in the -[Deno Deploy dashboard](https://dash.deno.com/orgs/new). Follow the on-screen -instructions to create a new organization for subhosting. - -Going through the onboarding flow, you will likely also generate an **access -token**, which you will use to access the [REST API](../api/index.md). If you -didn't do this (or lost the token you generated), you can -[generate a new one here](https://dash.deno.com/account#access-tokens). - -:::caution Save your token in a safe place - -Once you generate an access token, **it will not be displayed again within the -Deploy dashboard UI**. Make sure you store this token in a safe place. - -::: - -## Set up a test environment - -In the tutorial pages to follow, we will assume you are interacting with the -Deploy REST API through Deno scripts (TypeScript code), and will show examples -of interacting with the API in this way. However, the techniques shown here will -also work in any other environment capable of executing HTTP requests. - -The example code shown here and in future chapters assume that you have -[Deno 1.38 or higher](/runtime/manual/getting_started/installation) installed. - -When working with a REST API, it is useful to store authentication credentials -in the [system environment](/runtime/manual/basics/env_variables), to prevent -you from accidentally checking them in to source control. - -For this tutorial, we'll use the new `--env` flag -[introduced in Deno 1.38](https://deno.com/blog/v1.38#deno-run---env) to manage -environment variables. On your local computer, create a new directory to store -our management scripts in, and create three files: - -- `.env` - to hold our API access info -- `.gitignore` - to ignore our `.env` file so we don't put it in source control - by mistake -- `create_project.ts` - a file we'll use in a moment to make our first request - to the REST API - -### Configure a `.env` file and `.gitignore` file - -First, store your [access token](https://dash.deno.com/account#access-tokens) -and organization ID in the `.env` file you created earlier. - -```bash title=".env" -DEPLOY_ACCESS_TOKEN=your_token_here -DEPLOY_ORG_ID=your_org_id_here -``` - -Replace the values in the file with the values from your own Deploy account. - -Next, create a `.gitignore` file just to ensure we don't accidentally check our -`.env` file into source control: - -```bash title=".gitignore" -# Ignore this file in git -.env - -# Optional: ignore this junk file often generated on mac OS -.DS_Store -``` - -Now that we have our credentials set up, let's write some code to access the -REST API. - -## Creating our first project - -In order to do anything interesting with subhosting or the REST API, we'll need -to -[create a project](https://apidocs.deno.com/#get-/projects/-projectId-/deployments). -Copy the code below into a file named `create_project.ts` in the same file as -your `.env` and `.gitignore` file. - -```ts title="create_project.ts" -const accessToken = Deno.env.get("DEPLOY_ACCESS_TOKEN"); -const orgId = Deno.env.get("DEPLOY_ORG_ID"); -const API = "https://api.deno.com/v1"; - -// Create a new project -const res = await fetch(`${API}/organizations/${orgId}/projects`, { - method: "POST", - headers: { - Authorization: `Bearer ${accessToken}`, - "Content-Type": "application/json", - }, - body: JSON.stringify({ - name: null, // randomly generates project name - }), -}); - -const project = await res.json(); -console.log(project); -``` - -Execute this code with the following command in a terminal: - -```bash -deno run -A --env create_project.ts -``` - -If everything goes according to plan, you should see output that looks something -like this: - -```console -{ - id: "f084712a-b23b-4aba-accc-3c2de0bfa26a", - name: "strong-fox-44", - createdAt: "2023-11-07T01:01:14.078730Z", - updatedAt: "2023-11-07T01:01:14.078730Z" -} -``` - -Note the `id` of the project that was returned with this repsonse - this is the -project ID we'll use in the next step. - -Now that we have REST API access configured and a project set up, we can move on -to [creating our first deployment](./projects_and_deployments). diff --git a/subhosting/manual/index.md b/subhosting/manual/index.md index f51aea61e..cb9566dec 100644 --- a/subhosting/manual/index.md +++ b/subhosting/manual/index.md @@ -1,68 +1,55 @@ # About Subhosting -A powerful use case for Deno Deploy is using our isolate cloud to run untrusted -code on behalf of your end users. There are a number of scenarios where you -might be interested in doing this: - -- You are a SaaS provider that wants to empower your customers to extend your - platform with custom code -- You are an infrastructure provider that would like to enable your customers to - run Deno-powered edge functions -- You are building a browser-based editor for user code (possibly for - education), and you'd like a place to execute that code in a controlled and - secure way - -In cases like these, you might consider using Deno Deploy's full-featured -[REST API](../api/index.md) to implement -[**subhosting**](https://deno.com/subhosting). "Subhosting" is what we call the -scenario where you use Deno Deploy to run your users' untrusted code in a secure -and scalable environment designed for -[multitenancy](https://www.ibm.com/topics/multi-tenant). - -## Quick start example - -Looking for the smallest possible example that shows how to deploy code to -Deno's isolate cloud? We've got you covered below. Once you've skimmed over it, -you can read on for more details about subhosting. - -```ts -// 1.) Get API access info ready -const accessToken = Deno.env.get("DEPLOY_ACCESS_TOKEN"); -const orgId = Deno.env.get("DEPLOY_ORG_ID"); -const API = "https://api.deno.com/v1"; -const headers = { - Authorization: `Bearer ${accessToken}`, - "Content-Type": "application/json", -}; - -// 2.) Create a new project -const pr = await fetch(`${API}/organizations/${orgId}/projects`, { - method: "POST", - headers, - body: JSON.stringify({ - name: null, // randomly generates project name - }), -}); -const project = await pr.json(); - -// 3.) Deploy a "hello world" server to the new project -const dr = await fetch(`${API}/projects/${project.id}/deployments`, { - method: "POST", - headers, - body: JSON.stringify({ - entryPointUrl: "main.ts", - assets: { - "main.ts": { - "kind": "file", - "content": `Deno.serve(() => new Response("Hello, World!"));`, - "encoding": "utf-8", - }, - }, - envVars: {}, - }), -}); -console.log(dr.status); -``` +Deno Subhosting is a robust platform designed to allow Software as a Service +(SaaS) providers to securely run code written by their customers. The Subhosting +API allows you to deploy untrusted code programmatically and at scale. + +## Key Features + +- **Ease of Use:** Developers can write code in generic JavaScript or TypeScript + without needing specific knowledge of Deno. +- **Standards Compliance:** Deno supports standard JavaScript and TypeScript and + integrates widely-used web APIs like `fetch` and `web cache`. +- **Deno-Specific Advanced Features:** Offers advanced features like `KV` + (Key-Value stores) which extend beyond typical browser capabilities. +- **Rapid Deployment:** Deno’s cloud products are designed to support extremely + short deployment times that range from less than a second for simple + applications, to around ten seconds for complex websites with numerous + dependencies. +- **Improved developer experience**: Subhosting will manage the extensive effort + of setting up secure infrastructure to run untrusted code in a public cloud + for you. + +## **Overview of Deno Cloud Offerings: Deno Deploy and Deno Subhosting** + +Deno provides two distinct cloud offerings, Deno Deploy and Deno Subhosting, +each designed to support specific use cases while leveraging the same underlying +infrastructure. + +### **Deno Deploy** + +Deno Deploy is optimized for individual developers and small teams focused on +developing and iterating on a limited set of first-party projects. This solution +is ideal for hosting websites or applications, with deployment processes +typically managed through GitHub integrations. + +- Target Audience: Individual developers and small development teams. +- Deployment Integration: Primarily through GitHub for continuous integration + and delivery. +- Use Cases: Hosting websites and applications. + +### **Deno Subhosting** + +In contrast, Deno Subhosting is engineered to securely manage a larger volume of +projects and deployments. It supports the deployment of untrusted code or +functions through an API, making it suitable for scenarios involving multiple +end-users contributing code. + +- Target Audience: SaaS platforms requiring the capability to host + customer-generated, untrusted code securely. +- Deployment Mechanism: Through a robust API designed for scalability and + security. +- Use Cases: Large scale project hosting where end-users contribute the code. ## How subhosting works diff --git a/subhosting/manual/organizations.md b/subhosting/manual/organizations.md new file mode 100644 index 000000000..fda3e5bd9 --- /dev/null +++ b/subhosting/manual/organizations.md @@ -0,0 +1,13 @@ +# Organizations + +[**Organizations**](https://apidocs.deno.com/#get-/organizations/-organizationId-) +are a container for all data related to a subhosting implementation. Your +organization will have a name and an ID. Each organization has an analytics +endpoint which can be used to get metrics (such as request count and bandwidth +used) from across the organization. + +Other Deploy users can be invited to collaborate on an organization, and +[access tokens](https://dash.deno.com/account#access-tokens) can give developers +with organization access the ability to modify resources within the org via API. +New organizations can be created in the +[Deploy dashboard](https://dash.deno.com/orgs/new). diff --git a/subhosting/manual/projects.md b/subhosting/manual/projects.md new file mode 100644 index 000000000..8347dd5c3 --- /dev/null +++ b/subhosting/manual/projects.md @@ -0,0 +1,6 @@ +[**Projects**](https://apidocs.deno.com/#get-/organizations/-organizationId-/projects) +act as organizational containers for deployments. A project contains its +deployments and the analytics and usage information for those deployments. + +- Projects are free and can be set up as required. +- Analytics are reported on a per-project basis. diff --git a/subhosting/manual/quick_start.md b/subhosting/manual/quick_start.md new file mode 100644 index 000000000..75ac505da --- /dev/null +++ b/subhosting/manual/quick_start.md @@ -0,0 +1,169 @@ +# Subhosting Quick Start + +Looking for the smallest possible example that shows how to deploy code to +Deno's isolate cloud? We've got you covered below, or you can skip to the +[more detailed getting started guide](#getting_started). + +```ts +// 1.) Get API access info ready +const accessToken = Deno.env.get("DEPLOY_ACCESS_TOKEN"); +const orgId = Deno.env.get("DEPLOY_ORG_ID"); +const API = "https://api.deno.com/v1"; +const headers = { + Authorization: `Bearer ${accessToken}`, + "Content-Type": "application/json", +}; + +// 2.) Create a new project +const pr = await fetch(`${API}/organizations/${orgId}/projects`, { + method: "POST", + headers, + body: JSON.stringify({ + name: null, // randomly generates project name + }), +}); +const project = await pr.json(); + +// 3.) Deploy a "hello world" server to the new project +const dr = await fetch(`${API}/projects/${project.id}/deployments`, { + method: "POST", + headers, + body: JSON.stringify({ + entryPointUrl: "main.ts", + assets: { + "main.ts": { + "kind": "file", + "content": `Deno.serve(() => new Response("Hello, World!"));`, + "encoding": "utf-8", + }, + }, + envVars: {}, + }), +}); +console.log(dr.status); +``` + +
+ + +## Getting started with subhosting + +To get started with subhosting, you will need to create an organization in the +[Deno Deploy dashboard](https://dash.deno.com/orgs/new). Follow the on-screen +instructions to create a new organization for subhosting. + +Going through the onboarding flow, you will likely also generate an **access +token**, which you will use to access the [REST API](../api/index.md). If you +didn't do this (or lost the token you generated), you can +[generate a new one here](https://dash.deno.com/account#access-tokens). + +:::caution Save your token in a safe place + +Once you generate an access token, **it will not be displayed again within the +Deploy dashboard UI**. Make sure you store this token in a safe place. + +::: + +## Set up a test environment + +In the tutorial pages to follow, we will assume you are interacting with the +Deploy REST API through Deno scripts (TypeScript code), and will show examples +of interacting with the API in this way. However, the techniques shown here will +also work in any other environment capable of executing HTTP requests. + +The example code shown here and in future chapters assume that you have +[Deno 1.38 or higher](/runtime/manual/getting_started/installation) installed. + +When working with a REST API, it is useful to store authentication credentials +in the [system environment](/runtime/manual/basics/env_variables), to prevent +you from accidentally checking them in to source control. + +For this tutorial, we'll use the new `--env` flag +[introduced in Deno 1.38](https://deno.com/blog/v1.38#deno-run---env) to manage +environment variables. On your local computer, create a new directory to store +our management scripts in, and create three files: + +- `.env` - to hold our API access info +- `.gitignore` - to ignore our `.env` file so we don't put it in source control + by mistake +- `create_project.ts` - a file we'll use in a moment to make our first request + to the REST API + +### Configure a `.env` file and `.gitignore` file + +First, store your [access token](https://dash.deno.com/account#access-tokens) +and organization ID in the `.env` file you created earlier. + +```bash title=".env" +DEPLOY_ACCESS_TOKEN=your_token_here +DEPLOY_ORG_ID=your_org_id_here +``` + +Replace the values in the file with the values from your own Deploy account. + +Next, create a `.gitignore` file just to ensure we don't accidentally check our +`.env` file into source control: + +```bash title=".gitignore" +# Ignore this file in git +.env + +# Optional: ignore this junk file often generated on mac OS +.DS_Store +``` + +Now that we have our credentials set up, let's write some code to access the +REST API. + +## Creating our first project + +In order to do anything interesting with subhosting or the REST API, we'll need +to +[create a project](https://apidocs.deno.com/#get-/projects/-projectId-/deployments). +Copy the code below into a file named `create_project.ts` in the same file as +your `.env` and `.gitignore` file. + +```ts title="create_project.ts" +const accessToken = Deno.env.get("DEPLOY_ACCESS_TOKEN"); +const orgId = Deno.env.get("DEPLOY_ORG_ID"); +const API = "https://api.deno.com/v1"; + +// Create a new project +const res = await fetch(`${API}/organizations/${orgId}/projects`, { + method: "POST", + headers: { + Authorization: `Bearer ${accessToken}`, + "Content-Type": "application/json", + }, + body: JSON.stringify({ + name: null, // randomly generates project name + }), +}); + +const project = await res.json(); +console.log(project); +``` + +Execute this code with the following command in a terminal: + +```bash +deno run -A --env create_project.ts +``` + +If everything goes according to plan, you should see output that looks something +like this: + +```console +{ + id: "f084712a-b23b-4aba-accc-3c2de0bfa26a", + name: "strong-fox-44", + createdAt: "2023-11-07T01:01:14.078730Z", + updatedAt: "2023-11-07T01:01:14.078730Z" +} +``` + +Note the `id` of the project that was returned with this repsonse - this is the +project ID we'll use in the next step. + +Now that we have REST API access configured and a project set up, we can move on +to [creating our first deployment](./projects_and_deployments). diff --git a/subhosting/manual/usecases.md b/subhosting/manual/usecases.md new file mode 100644 index 000000000..705f2ae19 --- /dev/null +++ b/subhosting/manual/usecases.md @@ -0,0 +1,18 @@ +# Subhosting Usecases + +- Reselling serverless edge functions + - _Netlify_ runs edge functions written by their customers +- Customer written API adapters + - ? +- Simple customizations in low-code solutions + - E.g. ferrio +- Edge front-ends for websites/CMSs/ecommerce + - Deco.cx case study +- Customer developed widgets + - E.g. retune +- Executable code snippets (e.g. in documentation) + - Redocly (if they are still using subhosting) +- Scope of this documentation +- This doc covers how a SaaS application can programmatically deploy their end + user code to our platform. +- Documentation for end users is here -> link From 7511beed839fd0512788bebc96429a2ad005bf96 Mon Sep 17 00:00:00 2001 From: Jo Franchetti Date: Mon, 22 Apr 2024 14:52:13 +0100 Subject: [PATCH 02/14] move all to one page --- sidebars/subhosting.js | 21 +++--- subhosting/manual/databases.md | 6 -- subhosting/manual/deployments.md | 10 --- subhosting/manual/domains.md | 17 ----- subhosting/manual/organizations.md | 13 ---- subhosting/manual/projects.md | 6 -- subhosting/manual/subhosting.md | 101 +++++++++++++++++++++++++++++ 7 files changed, 114 insertions(+), 60 deletions(-) delete mode 100644 subhosting/manual/databases.md delete mode 100644 subhosting/manual/deployments.md delete mode 100644 subhosting/manual/domains.md delete mode 100644 subhosting/manual/organizations.md delete mode 100644 subhosting/manual/projects.md create mode 100644 subhosting/manual/subhosting.md diff --git a/sidebars/subhosting.js b/sidebars/subhosting.js index af5bc1ef8..05aeb9d0a 100644 --- a/sidebars/subhosting.js +++ b/sidebars/subhosting.js @@ -28,24 +28,29 @@ const sidebars = { className: "section-header", }, { - type: "doc", + type: "link", label: "Organizations", - id: "manual/organizations", + href: "manual/subhosting#organizations", }, { - type: "doc", + type: "link", label: "Projects", - id: "manual/projects", + href: "manual/subhosting#projects", }, { - type: "doc", + type: "link", label: "Deployments", - id: "manual/deployments", + href: "manual/subhosting#deployments", }, { - type: "doc", + type: "link", + label: "Custom Domains", + href: "manual/subhosting#domains", + }, + { + type: "link", label: "Custom Domains", - id: "manual/domains", + href: "manual/subhosting#database", }, "manual/projects_and_deployments", "manual/events", diff --git a/subhosting/manual/databases.md b/subhosting/manual/databases.md deleted file mode 100644 index 52b32638e..000000000 --- a/subhosting/manual/databases.md +++ /dev/null @@ -1,6 +0,0 @@ -# Connecting a Database - -A (KV) database stores key-value pairs -You can make a database accessible to a deployment when you make the deployment. -KV databases can be used by multiple deployments at the same time - diff --git a/subhosting/manual/deployments.md b/subhosting/manual/deployments.md deleted file mode 100644 index d2b3e1ae7..000000000 --- a/subhosting/manual/deployments.md +++ /dev/null @@ -1,10 +0,0 @@ -- [**Deployments**](https://apidocs.deno.com/#get-/projects/-projectId-/deployments): - a deployment is a set of configuration, runnable code, and supporting static - files that can run on an isolate in Deno Deploy. Deployments have an entry - file that can launch a server, can have a [Deno KV](/deploy/kv/manual) - database associated with them, and can be set up to run on custom domains. - -Deployments A deployment is an immutable object that consists of: Source code to -run Static assets Environment variables Database bindings Other settings We -provide endpoints for Querying or streaming build logs Querying or streaming -execution logs diff --git a/subhosting/manual/domains.md b/subhosting/manual/domains.md deleted file mode 100644 index 67d325176..000000000 --- a/subhosting/manual/domains.md +++ /dev/null @@ -1,17 +0,0 @@ -# Custom domains - -[** Custom domains**](https://apidocs.deno.com/#get-/organizations/-organizationId-/domains) -can be dynamically mapped to deployments, giving them a unique URL (eg -`mycompany.com`). - -Before a domain can be used you need to -[verify ownership and provision -or upload TLS certificates](https://github.com/denoland/deploy-api/blob/main/samples.ipynb). - -If you are on the [Builder tier](https://deno.com/deploy/pricing?subhosting) you -can use wildcard domains. Once you have a wildcard domain registered, you can -use it in two ways: - -- Send all requests for `*.mycompany.com` to a specific deployment -- (Coming soon) Assign different subdomains (e.g. `foo.mycompany.com` and - `bar.mycompany.com`) to separate deployments. diff --git a/subhosting/manual/organizations.md b/subhosting/manual/organizations.md deleted file mode 100644 index fda3e5bd9..000000000 --- a/subhosting/manual/organizations.md +++ /dev/null @@ -1,13 +0,0 @@ -# Organizations - -[**Organizations**](https://apidocs.deno.com/#get-/organizations/-organizationId-) -are a container for all data related to a subhosting implementation. Your -organization will have a name and an ID. Each organization has an analytics -endpoint which can be used to get metrics (such as request count and bandwidth -used) from across the organization. - -Other Deploy users can be invited to collaborate on an organization, and -[access tokens](https://dash.deno.com/account#access-tokens) can give developers -with organization access the ability to modify resources within the org via API. -New organizations can be created in the -[Deploy dashboard](https://dash.deno.com/orgs/new). diff --git a/subhosting/manual/projects.md b/subhosting/manual/projects.md deleted file mode 100644 index 8347dd5c3..000000000 --- a/subhosting/manual/projects.md +++ /dev/null @@ -1,6 +0,0 @@ -[**Projects**](https://apidocs.deno.com/#get-/organizations/-organizationId-/projects) -act as organizational containers for deployments. A project contains its -deployments and the analytics and usage information for those deployments. - -- Projects are free and can be set up as required. -- Analytics are reported on a per-project basis. diff --git a/subhosting/manual/subhosting.md b/subhosting/manual/subhosting.md new file mode 100644 index 000000000..52fa2d99b --- /dev/null +++ b/subhosting/manual/subhosting.md @@ -0,0 +1,101 @@ +# Subhosting Concepts + + + + + +## Organizations + +[**Organizations**](https://apidocs.deno.com/#get-/organizations/-organizationId-) +are a container for all data related to a subhosting implementation. Your +organization will have a name and an ID. Each organization has an analytics +endpoint which can be used to get metrics (such as request count and bandwidth +used) from across the organization. + +Other Deploy users can be invited to collaborate on an organization, and +[access tokens](https://dash.deno.com/account#access-tokens) can give developers +with organization access the ability to modify resources within the org via API. +New organizations can be created in the +[Deploy dashboard](https://dash.deno.com/orgs/new). + + + +## Deployments + +[**Deployments**](https://apidocs.deno.com/#get-/projects/-projectId-/deployments): +a deployment is a set of configuration, runnable code, and supporting static +files that can run on an isolate in Deno Deploy. Deployments have an entry file +that can launch a server, can have a [Deno KV](/deploy/kv/manual) database +associated with them, and can be set up to run on custom domains. + +A deployment is an immutable object that consists of: + +- Source code to run +- Static assets +- Environment variables +- Database bindings +- Other settings + +We provide endpoints for querying or streaming build logs and querying or +streaming execution logs. + +If you need to block or unblock a deployment you can do so by deleting the +deployment that you need to block or by unassigning its domains. This will make +the deployment unreachable. + +> NB. **Deployments are immutable**, however, you can create a new deployment +> and then remap its domain to the new deployment. The redeploy endpoint can +> create a new deployment from an existing one with different settings. + + + +## Projects + +[**Projects**](https://apidocs.deno.com/#get-/organizations/-organizationId-/projects) +act as organizational containers for deployments. A project contains its +deployments and the analytics and usage information for those deployments. + +- Projects are free and can be set up as required. +- Analytics are reported on a per-project basis. + +> All deployments (whether within a same project or between different projects) +> share nothing by default. Projects are a way to organize your deployments and +> do not cost anything. However analytics are reported on a per-project basis, +> if you have multiple tenants we recommend setting up a project for each. +> Particularly if you expect to bill your users for their usage. + + + +## Custom domains + +[** Custom domains**](https://apidocs.deno.com/#get-/organizations/-organizationId-/domains) +can be dynamically mapped to deployments, giving them a unique URL (eg +`mycompany.com`). + +Before a domain can be used you need to +[verify ownership and provision +or upload TLS certificates](https://github.com/denoland/deploy-api/blob/main/samples.ipynb). + +If you are on the [Builder tier](https://deno.com/deploy/pricing?subhosting) you +can use wildcard domains. Once you have a wildcard domain registered, you can +use it in two ways: + +- Send all requests for `*.mycompany.com` to a specific deployment +- (Coming soon) Assign different subdomains (e.g. `foo.mycompany.com` and + `bar.mycompany.com`) to separate deployments. + + + +## Connecting a Database + +A (KV) database stores key-value pairs You can make a database accessible to a +deployment when you make the deployment. KV databases can be used by multiple +deployments at the same time. + +To use KV with Subhosting: + +- [Create a database using the API](https://docs.deno.com/deploy/kv/manual) +- When you create a deployment using the Subhosting API, specify the database + you created. + +> NB. Deno Cron and Queues do not currently work for Subhosting. From 7c0ca0ad084bda8526c1afb5706bdbc7e97e6fbb Mon Sep 17 00:00:00 2001 From: Jo Franchetti Date: Tue, 23 Apr 2024 12:15:27 +0100 Subject: [PATCH 03/14] update --- sidebars/subhosting.js | 12 ++++++------ subhosting/manual/index.md | 33 +++------------------------------ subhosting/manual/subhosting.md | 14 +++++++++----- subhosting/manual/usecases.md | 2 ++ 4 files changed, 20 insertions(+), 41 deletions(-) diff --git a/sidebars/subhosting.js b/sidebars/subhosting.js index 05aeb9d0a..bc7693c28 100644 --- a/sidebars/subhosting.js +++ b/sidebars/subhosting.js @@ -30,27 +30,27 @@ const sidebars = { { type: "link", label: "Organizations", - href: "manual/subhosting#organizations", + href: "/subhosting/manual/subhosting#organizations", }, { type: "link", label: "Projects", - href: "manual/subhosting#projects", + href: "/subhosting/manual/subhosting#projects", }, { type: "link", label: "Deployments", - href: "manual/subhosting#deployments", + href: "/subhosting/manual/subhosting#deployments", }, { type: "link", label: "Custom Domains", - href: "manual/subhosting#domains", + href: "/subhosting/manual/subhosting#domains", }, { type: "link", - label: "Custom Domains", - href: "manual/subhosting#database", + label: "Connecting a Database", + href: "./manual/subhosting#database", }, "manual/projects_and_deployments", "manual/events", diff --git a/subhosting/manual/index.md b/subhosting/manual/index.md index cb9566dec..ff8456016 100644 --- a/subhosting/manual/index.md +++ b/subhosting/manual/index.md @@ -20,13 +20,13 @@ API allows you to deploy untrusted code programmatically and at scale. of setting up secure infrastructure to run untrusted code in a public cloud for you. -## **Overview of Deno Cloud Offerings: Deno Deploy and Deno Subhosting** +## Overview of Deno Cloud Offerings - Deno Deploy and Deno Subhosting Deno provides two distinct cloud offerings, Deno Deploy and Deno Subhosting, each designed to support specific use cases while leveraging the same underlying infrastructure. -### **Deno Deploy** +### Deno Deploy Deno Deploy is optimized for individual developers and small teams focused on developing and iterating on a limited set of first-party projects. This solution @@ -38,7 +38,7 @@ typically managed through GitHub integrations. and delivery. - Use Cases: Hosting websites and applications. -### **Deno Subhosting** +### Deno Subhosting In contrast, Deno Subhosting is engineered to securely manage a larger volume of projects and deployments. It supports the deployment of untrusted code or @@ -51,33 +51,6 @@ end-users contributing code. security. - Use Cases: Large scale project hosting where end-users contribute the code. -## How subhosting works - -To build subhosting with Deno Deploy, it helps to understand some key resources -within the system. These resources are also represented in the -[REST API](../api/index.md). - -![overview of subhosting resources](./subhosting-org-structure.svg) - -- [**Organizations**](https://apidocs.deno.com/#get-/organizations/-organizationId-): - Organizations are a container for all data related to a subhosting - implementation. Other Deploy users can be invited to collaborate on an - organization, and [access tokens](https://dash.deno.com/account#access-tokens) - can give developers with organization access the ability to modify resources - within the org via API. New organizations can be created in the - [Deploy dashboard](https://dash.deno.com/orgs/new). -- [**Projects**](https://apidocs.deno.com/#get-/organizations/-organizationId-/projects): - a project is a container for **deployments**, and the analytics and usage - information for all deployments within a project. -- [**Deployments**](https://apidocs.deno.com/#get-/projects/-projectId-/deployments): - a deployment is a set of configuration, runnable code, and supporting static - files that can run on an isolate in Deno Deploy. Deployments have an entry - file that can launch a server, can have a [Deno KV](/deploy/kv/manual) - database associated with them, and can be set up to run on custom domains. -- [**Domains**](https://apidocs.deno.com/#get-/organizations/-organizationId-/domains): - custom domains that can be associated with deployments, giving them a unique - URL. - The steps to implement subhosting are roughly as follows: 1. [Create an organization](./getting_started.md) and get an access token for diff --git a/subhosting/manual/subhosting.md b/subhosting/manual/subhosting.md index 52fa2d99b..7bfa1c247 100644 --- a/subhosting/manual/subhosting.md +++ b/subhosting/manual/subhosting.md @@ -1,8 +1,12 @@ # Subhosting Concepts +To build Subhosting with Deno Deploy, it helps to understand some key resources +within the system. These resources are also represented in the +[REST API](../api/index.md). +![overview of subhosting resources](./subhosting-org-structure.svg) - + ## Organizations @@ -18,7 +22,7 @@ with organization access the ability to modify resources within the org via API. New organizations can be created in the [Deploy dashboard](https://dash.deno.com/orgs/new). - + ## Deployments @@ -47,7 +51,7 @@ the deployment unreachable. > and then remap its domain to the new deployment. The redeploy endpoint can > create a new deployment from an existing one with different settings. - + ## Projects @@ -64,7 +68,7 @@ deployments and the analytics and usage information for those deployments. > if you have multiple tenants we recommend setting up a project for each. > Particularly if you expect to bill your users for their usage. - + ## Custom domains @@ -84,7 +88,7 @@ use it in two ways: - (Coming soon) Assign different subdomains (e.g. `foo.mycompany.com` and `bar.mycompany.com`) to separate deployments. - + ## Connecting a Database diff --git a/subhosting/manual/usecases.md b/subhosting/manual/usecases.md index 705f2ae19..d67d7f65e 100644 --- a/subhosting/manual/usecases.md +++ b/subhosting/manual/usecases.md @@ -16,3 +16,5 @@ - This doc covers how a SaaS application can programmatically deploy their end user code to our platform. - Documentation for end users is here -> link +How do I integrate an open source editor? +See our blog post about monaco From baa98a4c6b6775fdb210fe074ff2898f88c7b1a9 Mon Sep 17 00:00:00 2001 From: Jo Franchetti Date: Tue, 23 Apr 2024 15:33:52 +0100 Subject: [PATCH 04/14] update copy --- sidebars/subhosting.js | 6 ++--- subhosting/manual/getting_started.md | 0 subhosting/manual/subhosting.md | 33 ++++++++++++++++++++++------ 3 files changed, 29 insertions(+), 10 deletions(-) delete mode 100644 subhosting/manual/getting_started.md diff --git a/sidebars/subhosting.js b/sidebars/subhosting.js index bc7693c28..fc3cb25aa 100644 --- a/sidebars/subhosting.js +++ b/sidebars/subhosting.js @@ -28,9 +28,9 @@ const sidebars = { className: "section-header", }, { - type: "link", + type: "doc", label: "Organizations", - href: "/subhosting/manual/subhosting#organizations", + id: "manual/subhosting", }, { type: "link", @@ -50,7 +50,7 @@ const sidebars = { { type: "link", label: "Connecting a Database", - href: "./manual/subhosting#database", + href: "./subhosting/manual/subhosting#database", }, "manual/projects_and_deployments", "manual/events", diff --git a/subhosting/manual/getting_started.md b/subhosting/manual/getting_started.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/subhosting/manual/subhosting.md b/subhosting/manual/subhosting.md index 7bfa1c247..72aaddcfa 100644 --- a/subhosting/manual/subhosting.md +++ b/subhosting/manual/subhosting.md @@ -6,7 +6,7 @@ within the system. These resources are also represented in the ![overview of subhosting resources](./subhosting-org-structure.svg) - + ## Organizations @@ -22,7 +22,7 @@ with organization access the ability to modify resources within the org via API. New organizations can be created in the [Deploy dashboard](https://dash.deno.com/orgs/new). - + ## Deployments @@ -47,11 +47,19 @@ If you need to block or unblock a deployment you can do so by deleting the deployment that you need to block or by unassigning its domains. This will make the deployment unreachable. +The Subhosting system is built so that the behavior or load on one deployment +does not affect other deployments. This also applies to different deployments +within one organization. Capacity is auto-scaled on demand. If you want to limit +resources to a particular deployment or application you can use the analytics +API to provide you with detailed metrics (request count, bandwidth, etc) at +project level granularity. You can use this to decide whether to shut off +deployments and make them unreachable. + > NB. **Deployments are immutable**, however, you can create a new deployment > and then remap its domain to the new deployment. The redeploy endpoint can > create a new deployment from an existing one with different settings. - + ## Projects @@ -59,8 +67,11 @@ the deployment unreachable. act as organizational containers for deployments. A project contains its deployments and the analytics and usage information for those deployments. -- Projects are free and can be set up as required. -- Analytics are reported on a per-project basis. +Projects are free and can be set up as required. + +To track usage by individual users for billing there is an API endpoint that +reports analytics (bandwidth usage, request count, etc), per project, with 15 +minute granularity. > All deployments (whether within a same project or between different projects) > share nothing by default. Projects are a way to organize your deployments and @@ -68,7 +79,7 @@ deployments and the analytics and usage information for those deployments. > if you have multiple tenants we recommend setting up a project for each. > Particularly if you expect to bill your users for their usage. - + ## Custom domains @@ -88,7 +99,15 @@ use it in two ways: - (Coming soon) Assign different subdomains (e.g. `foo.mycompany.com` and `bar.mycompany.com`) to separate deployments. - +### Staging vs Production Environments + +The Deno Deploy end-user platform automatically creates preview deployments when +a developer opens a github pull request, and commits to the “main” branch are +automatically turned into production deployments. Although subhosting does not +provide github integration out of the box, it has all the primitives you need to +define your own semantics for creating preview and production deployments. + + ## Connecting a Database From 5fa307c87891fb51aea5f3daa2f54d2c66b61769 Mon Sep 17 00:00:00 2001 From: Jo Franchetti Date: Tue, 23 Apr 2024 16:10:44 +0100 Subject: [PATCH 05/14] add docs for pricing and acceptable use --- sidebars/subhosting.js | 11 +++++-- subhosting/manual/acceptable_use_policy.md | 30 +++++++++++++++++++ subhosting/manual/index.md | 8 ++--- ...nts.md => planning_your_implementation.md} | 11 +------ subhosting/manual/pricing_and_limits.md | 23 ++++++++++++++ 5 files changed, 66 insertions(+), 17 deletions(-) create mode 100644 subhosting/manual/acceptable_use_policy.md rename subhosting/manual/{projects_and_deployments.md => planning_your_implementation.md} (89%) create mode 100644 subhosting/manual/pricing_and_limits.md diff --git a/sidebars/subhosting.js b/sidebars/subhosting.js index fc3cb25aa..0ce3b0a60 100644 --- a/sidebars/subhosting.js +++ b/sidebars/subhosting.js @@ -7,6 +7,11 @@ const sidebars = { value: "
Getting Started
", className: "section-header", }, + { + type: "doc", + label: "About Subhosting", + id: "manual/index", + }, { type: "doc", label: "Quick Start", @@ -14,14 +19,15 @@ const sidebars = { }, { type: "doc", - label: "About Subhosting", - id: "manual/index", + label: "Planning your implementation", + id: "manual/planning_your_implementation", }, { type: "doc", label: "Subhosting Usecases", id: "manual/usecases", }, + { type: "html", value: "
Subhosting Platform
", @@ -52,7 +58,6 @@ const sidebars = { label: "Connecting a Database", href: "./subhosting/manual/subhosting#database", }, - "manual/projects_and_deployments", "manual/events", { type: "html", diff --git a/subhosting/manual/acceptable_use_policy.md b/subhosting/manual/acceptable_use_policy.md new file mode 100644 index 000000000..bb2dbf173 --- /dev/null +++ b/subhosting/manual/acceptable_use_policy.md @@ -0,0 +1,30 @@ +# Acceptable use policy + +The Deno Subhosting service includes resources (CPU time, request counts) that +are subject to this Acceptable Use policy. This document can give a rough +estimate to what we consider as "Acceptable Use", and what we do not. + +### Examples of Acceptable Use + +- ✅ Server-side rendered websites +- ✅ Jamstack sites and apps +- ✅ Single page applications +- ✅ APIs that query a DB or external API +- ✅ A personal blog +- ✅ A company website +- ✅ An e-commerce site + +### Not Acceptable Use + +- ❌ Crypto mining +- ❌ Highly CPU-intensive load (e.g. machine learning) +- ❌ Media hosting for external sites +- ❌ Scrapers +- ❌ Proxy or VPN + +## Guidelines + +We expect most projects to fall well within the usage limits. We will notify you +if your projects usage significantly deviates from the norm. We will reach out +to you where possible before taking any action to address unreasonable burdens +on our infrastructure. diff --git a/subhosting/manual/index.md b/subhosting/manual/index.md index ff8456016..f28066540 100644 --- a/subhosting/manual/index.md +++ b/subhosting/manual/index.md @@ -53,10 +53,10 @@ end-users contributing code. The steps to implement subhosting are roughly as follows: -1. [Create an organization](./getting_started.md) and get an access token for - the REST API -1. [Create a project](./projects_and_deployments.md), and then create your first - deployment for that project +1. [Create an organization](./quick_start.md) and get an access token for the + REST API +1. [Create a project](./planning_your_implementation.md), and then create your + first deployment for that project Using these techniques, you can package up user code as "deployments", and execute that code on a Deno-provisioned URL or a custom URL you can configure diff --git a/subhosting/manual/projects_and_deployments.md b/subhosting/manual/planning_your_implementation.md similarity index 89% rename from subhosting/manual/projects_and_deployments.md rename to subhosting/manual/planning_your_implementation.md index 1262d198b..37eb7c316 100644 --- a/subhosting/manual/projects_and_deployments.md +++ b/subhosting/manual/planning_your_implementation.md @@ -1,13 +1,4 @@ -# Projects and deployments - -In the [domain model for subhosting](./index.md), a **project** is a container -for **deployments**. You can track aggregate analytics for a project (like how -many requests are being processed, KV database usage, etc). But actual code that -runs and serves requests is contained in a **deployment**. Depending on the data -model for your application, you might choose to map projects and deployments in -different ways. - -## Planning your implementation +# Planning your implementation For example - let's say that you were building a SaaS CRM platform like Salesforce, and you wanted to empower your customers to write JavaScript code diff --git a/subhosting/manual/pricing_and_limits.md b/subhosting/manual/pricing_and_limits.md new file mode 100644 index 000000000..897466edc --- /dev/null +++ b/subhosting/manual/pricing_and_limits.md @@ -0,0 +1,23 @@ +# Pricing and Limits + +## Deployment size + +Deployments should be less than 1GB across all source code and assets in aggregate, per deployment. + +## Deployment frequency + +Bert to define, varies based on pricing tier. + +## CPU time per request + +* 50ms or 200ms, depending on tier. +* CPU time limit per request is limited on the average across many requests. It is not strictly enforced on a per-request basis. +* Does not include time that a deployment is waiting for I/O (e.g. while waiting for the remote server while making a fetch() request) + +## Blocking the event loop + +Programs should not block the event loop for more than 1s. + +## Available memory + +512MB max memory is available. From 42ac9f85b8f9f312e82d4d892457d8cbfcb19a60 Mon Sep 17 00:00:00 2001 From: Jo Franchetti Date: Tue, 23 Apr 2024 22:49:22 +0100 Subject: [PATCH 06/14] Update subhosting.js --- sidebars/subhosting.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sidebars/subhosting.js b/sidebars/subhosting.js index 0ce3b0a60..396a685ac 100644 --- a/sidebars/subhosting.js +++ b/sidebars/subhosting.js @@ -56,7 +56,7 @@ const sidebars = { { type: "link", label: "Connecting a Database", - href: "./subhosting/manual/subhosting#database", + href: "/subhosting/manual/subhosting#database", }, "manual/events", { From 888f0680af0ef96007fb5d28917da4e3abd3b76f Mon Sep 17 00:00:00 2001 From: Jo Franchetti Date: Tue, 23 Apr 2024 23:21:06 +0100 Subject: [PATCH 07/14] Update planning_your_implementation.md --- subhosting/manual/planning_your_implementation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subhosting/manual/planning_your_implementation.md b/subhosting/manual/planning_your_implementation.md index 37eb7c316..5191146e8 100644 --- a/subhosting/manual/planning_your_implementation.md +++ b/subhosting/manual/planning_your_implementation.md @@ -26,7 +26,7 @@ Let's look at an example of the API endpoint required to make this happen. ## Creating a deployment for a project -In the [previous chapter](./getting_started.md), you created a new project and +In the [previous chapter](./quick_start.md), you created a new project and noted its `id` property. In the example in the previous chapter, the ID was: ```console From 428f54e8c262dbc6e4385033fd51e63e9e15a832 Mon Sep 17 00:00:00 2001 From: Jo Franchetti Date: Tue, 23 Apr 2024 23:23:42 +0100 Subject: [PATCH 08/14] Update quick_start.md --- subhosting/manual/quick_start.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subhosting/manual/quick_start.md b/subhosting/manual/quick_start.md index 75ac505da..e38cbd47b 100644 --- a/subhosting/manual/quick_start.md +++ b/subhosting/manual/quick_start.md @@ -166,4 +166,4 @@ Note the `id` of the project that was returned with this repsonse - this is the project ID we'll use in the next step. Now that we have REST API access configured and a project set up, we can move on -to [creating our first deployment](./projects_and_deployments). +to [creating our first deployment](./planning_your_deployment). From 4319508ca5b1608130bebd33e4c651161ffee02a Mon Sep 17 00:00:00 2001 From: Jo Franchetti Date: Tue, 23 Apr 2024 23:29:25 +0100 Subject: [PATCH 09/14] Update quick_start.md --- subhosting/manual/quick_start.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subhosting/manual/quick_start.md b/subhosting/manual/quick_start.md index e38cbd47b..6346e4b08 100644 --- a/subhosting/manual/quick_start.md +++ b/subhosting/manual/quick_start.md @@ -166,4 +166,4 @@ Note the `id` of the project that was returned with this repsonse - this is the project ID we'll use in the next step. Now that we have REST API access configured and a project set up, we can move on -to [creating our first deployment](./planning_your_deployment). +to [creating our first deployment](./planning_your_implementation). From fb8567335a374a5a21d61cfa5b1a317462fe4690 Mon Sep 17 00:00:00 2001 From: Jo Franchetti Date: Thu, 25 Apr 2024 12:03:56 +0100 Subject: [PATCH 10/14] update order --- sidebars/subhosting.js | 2 +- subhosting/manual/index.md | 2 +- subhosting/manual/subhosting.md | 48 ++++++++++++++++----------------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/sidebars/subhosting.js b/sidebars/subhosting.js index 0ce3b0a60..396a685ac 100644 --- a/sidebars/subhosting.js +++ b/sidebars/subhosting.js @@ -56,7 +56,7 @@ const sidebars = { { type: "link", label: "Connecting a Database", - href: "./subhosting/manual/subhosting#database", + href: "/subhosting/manual/subhosting#database", }, "manual/events", { diff --git a/subhosting/manual/index.md b/subhosting/manual/index.md index f28066540..bc91fd2a4 100644 --- a/subhosting/manual/index.md +++ b/subhosting/manual/index.md @@ -59,7 +59,7 @@ The steps to implement subhosting are roughly as follows: first deployment for that project Using these techniques, you can package up user code as "deployments", and -execute that code on a Deno-provisioned URL or a custom URL you can configure +execute that code on a Deno-provisioned URL or a [custom URL](./subhosting#custom-domains) you can configure yourself. ## REST API reference and OpenAPI spec diff --git a/subhosting/manual/subhosting.md b/subhosting/manual/subhosting.md index 72aaddcfa..b28861f6e 100644 --- a/subhosting/manual/subhosting.md +++ b/subhosting/manual/subhosting.md @@ -6,7 +6,7 @@ within the system. These resources are also represented in the ![overview of subhosting resources](./subhosting-org-structure.svg) - + ## Organizations @@ -22,7 +22,27 @@ with organization access the ability to modify resources within the org via API. New organizations can be created in the [Deploy dashboard](https://dash.deno.com/orgs/new). - + + +## Projects + +[**Projects**](https://apidocs.deno.com/#get-/organizations/-organizationId-/projects) +act as organizational containers for deployments. A project contains its +deployments and the analytics and usage information for those deployments. + +Projects are free and can be set up as required. + +To track usage by individual users for billing there is an API endpoint that +reports analytics (bandwidth usage, request count, etc), per project, with 15 +minute granularity. + +> All deployments (whether within a same project or between different projects) +> share nothing by default. Projects are a way to organize your deployments and +> do not cost anything. However analytics are reported on a per-project basis, +> if you have multiple tenants we recommend setting up a project for each. +> Particularly if you expect to bill your users for their usage. + + ## Deployments @@ -59,27 +79,7 @@ deployments and make them unreachable. > and then remap its domain to the new deployment. The redeploy endpoint can > create a new deployment from an existing one with different settings. - - -## Projects - -[**Projects**](https://apidocs.deno.com/#get-/organizations/-organizationId-/projects) -act as organizational containers for deployments. A project contains its -deployments and the analytics and usage information for those deployments. - -Projects are free and can be set up as required. - -To track usage by individual users for billing there is an API endpoint that -reports analytics (bandwidth usage, request count, etc), per project, with 15 -minute granularity. - -> All deployments (whether within a same project or between different projects) -> share nothing by default. Projects are a way to organize your deployments and -> do not cost anything. However analytics are reported on a per-project basis, -> if you have multiple tenants we recommend setting up a project for each. -> Particularly if you expect to bill your users for their usage. - - + ## Custom domains @@ -107,7 +107,7 @@ automatically turned into production deployments. Although subhosting does not provide github integration out of the box, it has all the primitives you need to define your own semantics for creating preview and production deployments. - + ## Connecting a Database From 691e51f76a56f2e53c4193e0e42ab96fb7f06ce4 Mon Sep 17 00:00:00 2001 From: Jo Franchetti Date: Fri, 3 May 2024 10:27:50 +0100 Subject: [PATCH 11/14] updating subhosting doc navigation, moving resources to API section --- sidebars/subhosting.js | 35 ++----------------- subhosting/api/index.md | 17 +-------- .../manual/planning_your_implementation.md | 10 +++--- subhosting/manual/pricing_and_limits.md | 15 +++++--- subhosting/manual/quick_start.md | 3 +- subhosting/manual/subhosting.md | 30 ++++++++++++---- 6 files changed, 42 insertions(+), 68 deletions(-) diff --git a/sidebars/subhosting.js b/sidebars/subhosting.js index 396a685ac..3fe408098 100644 --- a/sidebars/subhosting.js +++ b/sidebars/subhosting.js @@ -22,48 +22,17 @@ const sidebars = { label: "Planning your implementation", id: "manual/planning_your_implementation", }, - { - type: "doc", - label: "Subhosting Usecases", - id: "manual/usecases", - }, - { type: "html", - value: "
Subhosting Platform
", + value: "
REST API
", className: "section-header", }, { type: "doc", - label: "Organizations", + label: "Resources", id: "manual/subhosting", }, - { - type: "link", - label: "Projects", - href: "/subhosting/manual/subhosting#projects", - }, - { - type: "link", - label: "Deployments", - href: "/subhosting/manual/subhosting#deployments", - }, - { - type: "link", - label: "Custom Domains", - href: "/subhosting/manual/subhosting#domains", - }, - { - type: "link", - label: "Connecting a Database", - href: "/subhosting/manual/subhosting#database", - }, "manual/events", - { - type: "html", - value: "
REST API
", - className: "section-header", - }, "api/index", { type: "link", diff --git a/subhosting/api/index.md b/subhosting/api/index.md index 529f80c4b..9e4a32e61 100644 --- a/subhosting/api/index.md +++ b/subhosting/api/index.md @@ -1,4 +1,4 @@ -# Subhosting REST API +# Authentication Developers can provision projects, domains, KV databases, and other resources using the Subhosting REST API. @@ -42,18 +42,3 @@ const res = await fetch( const response = await res.json(); console.log(response); ``` - -## OpenAPI specification and tooling - -The [OpenAPI specification](https://www.openapis.org/) for the Deploy API can be -found here: - -```console -https://api.deno.com/v1/openapi.json -``` - -This spec document can be used with a -[large number of OpenAPI-compatible tools](https://openapi.tools/). In addition -to the documentation for the REST API maintained here, you can find -auto-generated API documentation (including a browser-based testing tool) -[here](https://apidocs.deno.com/). diff --git a/subhosting/manual/planning_your_implementation.md b/subhosting/manual/planning_your_implementation.md index 5191146e8..369343177 100644 --- a/subhosting/manual/planning_your_implementation.md +++ b/subhosting/manual/planning_your_implementation.md @@ -1,8 +1,8 @@ # Planning your implementation -For example - let's say that you were building a SaaS CRM platform like -Salesforce, and you wanted to empower your customers to write JavaScript code -that would be executed every time a new lead was captured. +Let's say, for example, that you are building a SaaS CRM platform like +Salesforce. You want to empower your customers to write JavaScript code that +would be executed every time a new lead was captured. If you were going to implement this feature using Deno Deploy, here's how you might think about building it: @@ -26,8 +26,8 @@ Let's look at an example of the API endpoint required to make this happen. ## Creating a deployment for a project -In the [previous chapter](./quick_start.md), you created a new project and -noted its `id` property. In the example in the previous chapter, the ID was: +In the [previous chapter](./quick_start.md), you created a new project and noted +its `id` property. In the example in the previous chapter, the ID was: ```console f084712a-b23b-4aba-accc-3c2de0bfa26a diff --git a/subhosting/manual/pricing_and_limits.md b/subhosting/manual/pricing_and_limits.md index 897466edc..74774ac31 100644 --- a/subhosting/manual/pricing_and_limits.md +++ b/subhosting/manual/pricing_and_limits.md @@ -2,17 +2,22 @@ ## Deployment size -Deployments should be less than 1GB across all source code and assets in aggregate, per deployment. +Deployments should be less than 1GB across all source code and assets in +aggregate, per deployment. ## Deployment frequency -Bert to define, varies based on pricing tier. +The maximum number of deployments per hour that a subhosting user can make is +either 60 (on the free tier) or 300 (on the builder tier). Higher limits are +available for organizations on the enterprise plan. ## CPU time per request -* 50ms or 200ms, depending on tier. -* CPU time limit per request is limited on the average across many requests. It is not strictly enforced on a per-request basis. -* Does not include time that a deployment is waiting for I/O (e.g. while waiting for the remote server while making a fetch() request) +- 50ms or 200ms, depending on tier. +- CPU time limit per request is limited on the average across many requests. It + is not strictly enforced on a per-request basis. +- Does not include time that a deployment is waiting for I/O (e.g. while waiting + for the remote server while making a fetch() request) ## Blocking the event loop diff --git a/subhosting/manual/quick_start.md b/subhosting/manual/quick_start.md index 6346e4b08..cd446ef9c 100644 --- a/subhosting/manual/quick_start.md +++ b/subhosting/manual/quick_start.md @@ -43,7 +43,6 @@ const dr = await fetch(`${API}/projects/${project.id}/deployments`, { console.log(dr.status); ``` -
## Getting started with subhosting @@ -54,7 +53,7 @@ instructions to create a new organization for subhosting. Going through the onboarding flow, you will likely also generate an **access token**, which you will use to access the [REST API](../api/index.md). If you -didn't do this (or lost the token you generated), you can +didn't do this (or your token has expired), you can [generate a new one here](https://dash.deno.com/account#access-tokens). :::caution Save your token in a safe place diff --git a/subhosting/manual/subhosting.md b/subhosting/manual/subhosting.md index b28861f6e..30b251f7b 100644 --- a/subhosting/manual/subhosting.md +++ b/subhosting/manual/subhosting.md @@ -1,4 +1,4 @@ -# Subhosting Concepts +# Subhosting Resources To build Subhosting with Deno Deploy, it helps to understand some key resources within the system. These resources are also represented in the @@ -6,7 +6,7 @@ within the system. These resources are also represented in the ![overview of subhosting resources](./subhosting-org-structure.svg) - + ## Organizations @@ -22,7 +22,7 @@ with organization access the ability to modify resources within the org via API. New organizations can be created in the [Deploy dashboard](https://dash.deno.com/orgs/new). - + ## Projects @@ -42,7 +42,7 @@ minute granularity. > if you have multiple tenants we recommend setting up a project for each. > Particularly if you expect to bill your users for their usage. - + ## Deployments @@ -79,7 +79,7 @@ deployments and make them unreachable. > and then remap its domain to the new deployment. The redeploy endpoint can > create a new deployment from an existing one with different settings. - + ## Custom domains @@ -107,9 +107,9 @@ automatically turned into production deployments. Although subhosting does not provide github integration out of the box, it has all the primitives you need to define your own semantics for creating preview and production deployments. - + -## Connecting a Database +## Connecting a KV Database A (KV) database stores key-value pairs You can make a database accessible to a deployment when you make the deployment. KV databases can be used by multiple @@ -122,3 +122,19 @@ To use KV with Subhosting: you created. > NB. Deno Cron and Queues do not currently work for Subhosting. + + +## OpenAPI specification and tooling + +The [OpenAPI specification](https://www.openapis.org/) for the Deploy API can be +found here: + +```console +https://api.deno.com/v1/openapi.json +``` + +This spec document can be used with a +[large number of OpenAPI-compatible tools](https://openapi.tools/). In addition +to the documentation for the REST API maintained here, you can find +auto-generated API documentation (including a browser-based testing tool) +[here](https://apidocs.deno.com/). From c180b1953f84215766d406db28d0540cdc864ba0 Mon Sep 17 00:00:00 2001 From: Jo Franchetti Date: Wed, 8 May 2024 09:42:03 +0100 Subject: [PATCH 12/14] updating folder structure --- sidebars/subhosting.js | 13 +- subhosting/api/index.md | 170 ++++++++++++++---- .../manual/subhosting-org-structure.svg | 87 --------- subhosting/manual/subhosting.md | 140 --------------- subhosting/manual/usecases.md | 20 --- 5 files changed, 144 insertions(+), 286 deletions(-) delete mode 100644 subhosting/manual/subhosting-org-structure.svg delete mode 100644 subhosting/manual/subhosting.md delete mode 100644 subhosting/manual/usecases.md diff --git a/sidebars/subhosting.js b/sidebars/subhosting.js index 3fe408098..62f3b3e22 100644 --- a/sidebars/subhosting.js +++ b/sidebars/subhosting.js @@ -22,6 +22,11 @@ const sidebars = { label: "Planning your implementation", id: "manual/planning_your_implementation", }, + { + type: "doc", + label: "Pricing and Limits", + id: "manual/pricing_and_limits", + }, { type: "html", value: "
REST API
", @@ -30,10 +35,14 @@ const sidebars = { { type: "doc", label: "Resources", - id: "manual/subhosting", + id: "api/index", + }, + { + type: "doc", + label: "Authentication", + id: "api/authentication", }, "manual/events", - "api/index", { type: "link", label: "API Reference Docs", diff --git a/subhosting/api/index.md b/subhosting/api/index.md index 9e4a32e61..7bdb1af60 100644 --- a/subhosting/api/index.md +++ b/subhosting/api/index.md @@ -1,44 +1,140 @@ -# Authentication +# Subhosting Resources -Developers can provision projects, domains, KV databases, and other resources -using the Subhosting REST API. +To build Subhosting with Deno Deploy, it helps to understand some key resources +within the system. These resources are also represented in the +[REST API](../api/index.md). -## Endpoint and authentication +![overview of subhosting resources](./images/subhosting-org-structure.svg) -The base URL for the Subhosting REST API v1 is below. + + +## Organizations + +[**Organizations**](https://apidocs.deno.com/#get-/organizations/-organizationId-) +are a container for all data related to a subhosting implementation. Your +organization will have a name and an ID. Each organization has an analytics +endpoint which can be used to get metrics (such as request count and bandwidth +used) from across the organization. + +Other Deploy users can be invited to collaborate on an organization, and +[access tokens](https://dash.deno.com/account#access-tokens) can give developers +with organization access the ability to modify resources within the org via API. +New organizations can be created in the +[Deploy dashboard](https://dash.deno.com/orgs/new). + + + +## Projects + +[**Projects**](https://apidocs.deno.com/#get-/organizations/-organizationId-/projects) +act as organizational containers for deployments. A project contains its +deployments and the analytics and usage information for those deployments. + +Projects are free and can be set up as required. + +To track usage by individual users for billing there is an API endpoint that +reports analytics (bandwidth usage, request count, etc), per project, with 15 +minute granularity. + +> All deployments (whether within a same project or between different projects) +> share nothing by default. Projects are a way to organize your deployments and +> do not cost anything. However analytics are reported on a per-project basis, +> if you have multiple tenants we recommend setting up a project for each. +> Particularly if you expect to bill your users for their usage. + + + +## Deployments + +[**Deployments**](https://apidocs.deno.com/#get-/projects/-projectId-/deployments): +a deployment is a set of configuration, runnable code, and supporting static +files that can run on an isolate in Deno Deploy. Deployments have an entry file +that can launch a server, can have a [Deno KV](/deploy/kv/manual) database +associated with them, and can be set up to run on custom domains. + +A deployment is an immutable object that consists of: + +- Source code to run +- Static assets +- Environment variables +- Database bindings +- Other settings + +We provide endpoints for querying or streaming build logs and querying or +streaming execution logs. + +If you need to block or unblock a deployment you can do so by deleting the +deployment that you need to block or by unassigning its domains. This will make +the deployment unreachable. + +The Subhosting system is built so that the behavior or load on one deployment +does not affect other deployments. This also applies to different deployments +within one organization. Capacity is auto-scaled on demand. If you want to limit +resources to a particular deployment or application you can use the analytics +API to provide you with detailed metrics (request count, bandwidth, etc) at +project level granularity. You can use this to decide whether to shut off +deployments and make them unreachable. + +> NB. **Deployments are immutable**, however, you can create a new deployment +> and then remap its domain to the new deployment. The redeploy endpoint can +> create a new deployment from an existing one with different settings. + + + +## Custom domains + +[** Custom domains**](https://apidocs.deno.com/#get-/organizations/-organizationId-/domains) +can be dynamically mapped to deployments, giving them a unique URL (eg +`mycompany.com`). + +Before a domain can be used you need to +[verify ownership and provision +or upload TLS certificates](https://github.com/denoland/deploy-api/blob/main/samples.ipynb). + +If you are on the [Builder tier](https://deno.com/deploy/pricing?subhosting) you +can use wildcard domains. Once you have a wildcard domain registered, you can +use it in two ways: + +- Send all requests for `*.mycompany.com` to a specific deployment +- (Coming soon) Assign different subdomains (e.g. `foo.mycompany.com` and + `bar.mycompany.com`) to separate deployments. + +### Staging vs Production Environments + +The Deno Deploy end-user platform automatically creates preview deployments when +a developer opens a github pull request, and commits to the “main” branch are +automatically turned into production deployments. Although subhosting does not +provide github integration out of the box, it has all the primitives you need to +define your own semantics for creating preview and production deployments. + + + +## Connecting a KV Database + +A (KV) database stores key-value pairs You can make a database accessible to a +deployment when you make the deployment. KV databases can be used by multiple +deployments at the same time. + +To use KV with Subhosting: + +- [Create a database using the API](https://docs.deno.com/deploy/kv/manual) +- When you create a deployment using the Subhosting API, specify the database + you created. + +> NB. Deno Cron and Queues do not currently work for Subhosting. + + +## OpenAPI specification and tooling + +The [OpenAPI specification](https://www.openapis.org/) for the Deploy API can be +found here: ```console -https://api.deno.com/v1/ +https://api.deno.com/v1/openapi.json ``` -The v1 API uses -[HTTP bearer token](https://swagger.io/docs/specification/authentication/bearer-authentication/) -authentication. You can create an access token to use the API in the dashboard -[here](https://dash.deno.com/account#access-tokens). Most API requests will also -require your organization ID. You can retrieve yours from the Deno Deploy -dashboard for your organization. - -![Find your org ID here](./images/org-id.png) - -Using both your organization ID and your access token, you can test your API -access by listing all the projects associated with your organization. Here is an -example Deno script you can use to access the API. - -```typescript -// Replace these with your own! -const organizationId = "a75a9caa-b8ac-47b3-a423-3f2077c58731"; -const token = "ddo_u7mo08lBNHm8GMGLhtrEVfcgBsCuSp36dumX"; - -const res = await fetch( - `https://api.deno.com/v1/organizations/${organizationId}/projects`, - { - method: "GET", - headers: { - Authorization: `Bearer ${token}`, - }, - }, -); - -const response = await res.json(); -console.log(response); -``` +This spec document can be used with a +[large number of OpenAPI-compatible tools](https://openapi.tools/). In addition +to the documentation for the REST API maintained here, you can find +auto-generated API documentation (including a browser-based testing tool) +[here](https://apidocs.deno.com/). diff --git a/subhosting/manual/subhosting-org-structure.svg b/subhosting/manual/subhosting-org-structure.svg deleted file mode 100644 index 6fb054e0b..000000000 --- a/subhosting/manual/subhosting-org-structure.svg +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/subhosting/manual/subhosting.md b/subhosting/manual/subhosting.md deleted file mode 100644 index 30b251f7b..000000000 --- a/subhosting/manual/subhosting.md +++ /dev/null @@ -1,140 +0,0 @@ -# Subhosting Resources - -To build Subhosting with Deno Deploy, it helps to understand some key resources -within the system. These resources are also represented in the -[REST API](../api/index.md). - -![overview of subhosting resources](./subhosting-org-structure.svg) - - - -## Organizations - -[**Organizations**](https://apidocs.deno.com/#get-/organizations/-organizationId-) -are a container for all data related to a subhosting implementation. Your -organization will have a name and an ID. Each organization has an analytics -endpoint which can be used to get metrics (such as request count and bandwidth -used) from across the organization. - -Other Deploy users can be invited to collaborate on an organization, and -[access tokens](https://dash.deno.com/account#access-tokens) can give developers -with organization access the ability to modify resources within the org via API. -New organizations can be created in the -[Deploy dashboard](https://dash.deno.com/orgs/new). - - - -## Projects - -[**Projects**](https://apidocs.deno.com/#get-/organizations/-organizationId-/projects) -act as organizational containers for deployments. A project contains its -deployments and the analytics and usage information for those deployments. - -Projects are free and can be set up as required. - -To track usage by individual users for billing there is an API endpoint that -reports analytics (bandwidth usage, request count, etc), per project, with 15 -minute granularity. - -> All deployments (whether within a same project or between different projects) -> share nothing by default. Projects are a way to organize your deployments and -> do not cost anything. However analytics are reported on a per-project basis, -> if you have multiple tenants we recommend setting up a project for each. -> Particularly if you expect to bill your users for their usage. - - - -## Deployments - -[**Deployments**](https://apidocs.deno.com/#get-/projects/-projectId-/deployments): -a deployment is a set of configuration, runnable code, and supporting static -files that can run on an isolate in Deno Deploy. Deployments have an entry file -that can launch a server, can have a [Deno KV](/deploy/kv/manual) database -associated with them, and can be set up to run on custom domains. - -A deployment is an immutable object that consists of: - -- Source code to run -- Static assets -- Environment variables -- Database bindings -- Other settings - -We provide endpoints for querying or streaming build logs and querying or -streaming execution logs. - -If you need to block or unblock a deployment you can do so by deleting the -deployment that you need to block or by unassigning its domains. This will make -the deployment unreachable. - -The Subhosting system is built so that the behavior or load on one deployment -does not affect other deployments. This also applies to different deployments -within one organization. Capacity is auto-scaled on demand. If you want to limit -resources to a particular deployment or application you can use the analytics -API to provide you with detailed metrics (request count, bandwidth, etc) at -project level granularity. You can use this to decide whether to shut off -deployments and make them unreachable. - -> NB. **Deployments are immutable**, however, you can create a new deployment -> and then remap its domain to the new deployment. The redeploy endpoint can -> create a new deployment from an existing one with different settings. - - - -## Custom domains - -[** Custom domains**](https://apidocs.deno.com/#get-/organizations/-organizationId-/domains) -can be dynamically mapped to deployments, giving them a unique URL (eg -`mycompany.com`). - -Before a domain can be used you need to -[verify ownership and provision -or upload TLS certificates](https://github.com/denoland/deploy-api/blob/main/samples.ipynb). - -If you are on the [Builder tier](https://deno.com/deploy/pricing?subhosting) you -can use wildcard domains. Once you have a wildcard domain registered, you can -use it in two ways: - -- Send all requests for `*.mycompany.com` to a specific deployment -- (Coming soon) Assign different subdomains (e.g. `foo.mycompany.com` and - `bar.mycompany.com`) to separate deployments. - -### Staging vs Production Environments - -The Deno Deploy end-user platform automatically creates preview deployments when -a developer opens a github pull request, and commits to the “main” branch are -automatically turned into production deployments. Although subhosting does not -provide github integration out of the box, it has all the primitives you need to -define your own semantics for creating preview and production deployments. - - - -## Connecting a KV Database - -A (KV) database stores key-value pairs You can make a database accessible to a -deployment when you make the deployment. KV databases can be used by multiple -deployments at the same time. - -To use KV with Subhosting: - -- [Create a database using the API](https://docs.deno.com/deploy/kv/manual) -- When you create a deployment using the Subhosting API, specify the database - you created. - -> NB. Deno Cron and Queues do not currently work for Subhosting. - - -## OpenAPI specification and tooling - -The [OpenAPI specification](https://www.openapis.org/) for the Deploy API can be -found here: - -```console -https://api.deno.com/v1/openapi.json -``` - -This spec document can be used with a -[large number of OpenAPI-compatible tools](https://openapi.tools/). In addition -to the documentation for the REST API maintained here, you can find -auto-generated API documentation (including a browser-based testing tool) -[here](https://apidocs.deno.com/). diff --git a/subhosting/manual/usecases.md b/subhosting/manual/usecases.md deleted file mode 100644 index d67d7f65e..000000000 --- a/subhosting/manual/usecases.md +++ /dev/null @@ -1,20 +0,0 @@ -# Subhosting Usecases - -- Reselling serverless edge functions - - _Netlify_ runs edge functions written by their customers -- Customer written API adapters - - ? -- Simple customizations in low-code solutions - - E.g. ferrio -- Edge front-ends for websites/CMSs/ecommerce - - Deco.cx case study -- Customer developed widgets - - E.g. retune -- Executable code snippets (e.g. in documentation) - - Redocly (if they are still using subhosting) -- Scope of this documentation -- This doc covers how a SaaS application can programmatically deploy their end - user code to our platform. -- Documentation for end users is here -> link -How do I integrate an open source editor? -See our blog post about monaco From e6e75ef05c09318ae06090ddbac7b8e0fb5114dc Mon Sep 17 00:00:00 2001 From: Jo Franchetti Date: Wed, 8 May 2024 09:43:34 +0100 Subject: [PATCH 13/14] move files --- subhosting/api/authentication.md | 44 ++++++++++ .../api/images/subhosting-org-structure.svg | 87 +++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 subhosting/api/authentication.md create mode 100644 subhosting/api/images/subhosting-org-structure.svg diff --git a/subhosting/api/authentication.md b/subhosting/api/authentication.md new file mode 100644 index 000000000..9e4a32e61 --- /dev/null +++ b/subhosting/api/authentication.md @@ -0,0 +1,44 @@ +# Authentication + +Developers can provision projects, domains, KV databases, and other resources +using the Subhosting REST API. + +## Endpoint and authentication + +The base URL for the Subhosting REST API v1 is below. + +```console +https://api.deno.com/v1/ +``` + +The v1 API uses +[HTTP bearer token](https://swagger.io/docs/specification/authentication/bearer-authentication/) +authentication. You can create an access token to use the API in the dashboard +[here](https://dash.deno.com/account#access-tokens). Most API requests will also +require your organization ID. You can retrieve yours from the Deno Deploy +dashboard for your organization. + +![Find your org ID here](./images/org-id.png) + +Using both your organization ID and your access token, you can test your API +access by listing all the projects associated with your organization. Here is an +example Deno script you can use to access the API. + +```typescript +// Replace these with your own! +const organizationId = "a75a9caa-b8ac-47b3-a423-3f2077c58731"; +const token = "ddo_u7mo08lBNHm8GMGLhtrEVfcgBsCuSp36dumX"; + +const res = await fetch( + `https://api.deno.com/v1/organizations/${organizationId}/projects`, + { + method: "GET", + headers: { + Authorization: `Bearer ${token}`, + }, + }, +); + +const response = await res.json(); +console.log(response); +``` diff --git a/subhosting/api/images/subhosting-org-structure.svg b/subhosting/api/images/subhosting-org-structure.svg new file mode 100644 index 000000000..6fb054e0b --- /dev/null +++ b/subhosting/api/images/subhosting-org-structure.svg @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From e88121852ecbe3df424f5c869c8031b2360c9903 Mon Sep 17 00:00:00 2001 From: Jo Franchetti Date: Wed, 8 May 2024 09:53:34 +0100 Subject: [PATCH 14/14] fixing broken link --- subhosting/api/index.md | 2 +- subhosting/manual/index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/subhosting/api/index.md b/subhosting/api/index.md index 7bdb1af60..dddf14add 100644 --- a/subhosting/api/index.md +++ b/subhosting/api/index.md @@ -83,7 +83,7 @@ deployments and make them unreachable. ## Custom domains -[** Custom domains**](https://apidocs.deno.com/#get-/organizations/-organizationId-/domains) +[**Custom domains**](https://apidocs.deno.com/#get-/organizations/-organizationId-/domains) can be dynamically mapped to deployments, giving them a unique URL (eg `mycompany.com`). diff --git a/subhosting/manual/index.md b/subhosting/manual/index.md index bc91fd2a4..2c80761df 100644 --- a/subhosting/manual/index.md +++ b/subhosting/manual/index.md @@ -59,7 +59,7 @@ The steps to implement subhosting are roughly as follows: first deployment for that project Using these techniques, you can package up user code as "deployments", and -execute that code on a Deno-provisioned URL or a [custom URL](./subhosting#custom-domains) you can configure +execute that code on a Deno-provisioned URL or a [custom URL](../api/#custom-domains) you can configure yourself. ## REST API reference and OpenAPI spec