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/).