Skip to content

Commit 615ce39

Browse files
authored
chore: update readme (#228)
1 parent 24e97f2 commit 615ce39

File tree

1 file changed

+52
-8
lines changed

1 file changed

+52
-8
lines changed

README.md

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,64 @@ Nitric SDKs provide an infrastructure-as-code style that lets you define resourc
2727

2828
You can request the type of access you need to resources such as publishing for topics, without dealing directly with IAM or policy documents.
2929

30-
## Status
30+
- Reference Documentation: https://nitric.io/docs/reference/nodejs
31+
- Guides: https://nitric.io/docs/guides/nodejs
3132

32-
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!
33+
## Usage
34+
35+
### Starting a new project
36+
37+
Install the [Nitric CLI](https://nitric.io/docs/getting-started/installation), then generate your project:
38+
39+
TypeScript:
40+
41+
```bash
42+
nitric new hello-world ts-starter
43+
```
44+
45+
JavaScript:
46+
47+
```bash
48+
nitric new hello-world js-starter
49+
```
50+
51+
### Adding to an existing project
52+
53+
First of all, you need to install the library:
54+
55+
```bash
56+
npm install @nitric/sdk
57+
```
58+
59+
Then you're able to import the library and create cloud resources:
60+
61+
```typescript
62+
import { api, bucket } from '@nitric/sdk';
63+
64+
const publicApi = api('public');
65+
const uploads = bucket('uploads').allow('write');
66+
67+
publicApi.get('/upload', async (ctx) => {
68+
const photo = uploads.file('images/photo.png');
69+
70+
const url = await photo.getUploadUrl({
71+
expiry: 300,
72+
});
73+
74+
return ctx.res.json({ url });
75+
});
76+
```
77+
78+
## Learn more
79+
80+
Learn more by checking out the [Nitric documentation](https://nitric.io/docs).
3381

3482
## Get in touch:
3583

36-
- Ask questions in [GitHub discussions](https://github.com/nitrictech/nitric/discussions)
84+
- Join us on [Discord](https://nitric.io/chat)
3785

38-
- Join us on [Discord](https://discord.gg/Webemece5C)
86+
- Ask questions in [GitHub discussions](https://github.com/nitrictech/nitric/discussions)
3987

4088
- Find us on [Twitter](https://twitter.com/nitric_io)
4189

4290
- Send us an [email](mailto:[email protected])
43-
44-
## Get Started
45-
46-
Check out the [Nitric docs](https://nitric.io/docs) to see how to get started using Nitric.

0 commit comments

Comments
 (0)