Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
davemooreuws committed Jul 4, 2024
1 parent 24e97f2 commit 6d682af
Showing 1 changed file with 51 additions and 4 deletions.
55 changes: 51 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,62 @@ 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 photoUrl = await photo.getUploadUrl({
expiry: 300,
});

ctx.res.status = 301;
ctx.res.headers['Location'] = [photoUrl];

return ctx;
});
```

## 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)

Expand Down

0 comments on commit 6d682af

Please sign in to comment.