From 7e87f7f2a1810bc032da0aabd27c52919140f253 Mon Sep 17 00:00:00 2001 From: David Moore Date: Fri, 5 Jul 2024 10:10:47 +1000 Subject: [PATCH 1/2] chore: update readme --- README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3e1f3be2..6afa0c74 100644 --- a/README.md +++ b/README.md @@ -27,15 +27,59 @@ Nitric SDKs provide an infrastructure-as-code style that lets you define resourc You can request the type of access you need to resources such as publishing for topics, without dealing directly with IAM or policy documents. -## Status +- Reference Documentation: https://nitric.io/docs/reference/nodejs +- Guides: https://nitric.io/docs/guides/nodejs -The SDK is in early stage development and APIs and interfaces are still subject to breaking changes. We’d love your feedback as we build additional functionality! +## Usage + +### Starting a new project + +Install the [Nitric CLI](https://nitric.io/docs/getting-started/installation), then generate your project: + +TypeScript: + +```bash +nitric new hello-world ts-starter +``` + +JavaScript: + +```bash +nitric new hello-world js-starter +``` + +### Adding to an existing project + +First of all, you need to install the library: + +```bash +npm install @nitric/sdk +``` + +Then you're able to import the library and create cloud resources: + +```typescript +import { api, bucket } from '@nitric/sdk'; + +const publicApi = api('public'); +const uploads = bucket('uploads').allow('write'); + +publicApi.get('/upload', async (ctx) => { + const photo = uploads.file('images/photo.png'); + + const url = await photo.getUploadUrl({ + expiry: 300, + }); + + return ctx.res.json({ url }); +}); +``` ## Get in touch: -- Ask questions in [GitHub discussions](https://github.com/nitrictech/nitric/discussions) +- Join us on [Discord](https://nitric.io/chat) -- Join us on [Discord](https://discord.gg/Webemece5C) +- Ask questions in [GitHub discussions](https://github.com/nitrictech/nitric/discussions) - Find us on [Twitter](https://twitter.com/nitric_io) From b6fcb6c97ec6f10d1a8e23a0f3cafe1299923435 Mon Sep 17 00:00:00 2001 From: David Moore Date: Fri, 5 Jul 2024 10:35:57 +1000 Subject: [PATCH 2/2] update --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6afa0c74..b034e3b2 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,10 @@ publicApi.get('/upload', async (ctx) => { }); ``` +## Learn more + +Learn more by checking out the [Nitric documentation](https://nitric.io/docs). + ## Get in touch: - Join us on [Discord](https://nitric.io/chat) @@ -84,7 +88,3 @@ publicApi.get('/upload', async (ctx) => { - Find us on [Twitter](https://twitter.com/nitric_io) - Send us an [email](mailto:maintainers@nitric.io) - -## Get Started - -Check out the [Nitric docs](https://nitric.io/docs) to see how to get started using Nitric.