You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
34
-
35
-
## Get in touch
36
-
37
-
- Ask questions in [GitHub discussions](https://github.com/nitrictech/nitric/discussions)
38
-
39
-
- Join us on [Discord](https://discord.gg/Webemece5C)
40
-
41
-
- Find us on [Twitter](https://twitter.com/nitric_io)
42
-
43
-
- Send us an [email](mailto:maintainers@nitric.io)
44
-
45
-
## Getting Started
34
+
## Usage
46
35
47
-
### Using the [Nitric CLI](https://github.com/nitrictech/cli)
36
+
### Starting a new project
48
37
49
-
> nitric is included in all python related projects by default
38
+
Install the [Nitric CLI](https://nitric.io/docs/getting-started/installation), then generate your project:
50
39
51
40
```bash
52
41
nitric new hello-world py-starter
53
42
```
54
43
55
44
### Adding to an existing project
56
45
46
+
First of all, you need to install the library:
47
+
57
48
**pip**
58
49
59
50
```bash
60
-
# Install the Nitric SDK
61
51
pip3 install nitric
62
52
```
63
53
@@ -67,6 +57,37 @@ pip3 install nitric
67
57
pipenv install nitric
68
58
```
69
59
70
-
## Usage
60
+
Then you're able to import the library and create cloud resources:
61
+
62
+
```python
63
+
from nitric.resources import api, bucket
64
+
from nitric.application import Nitric
65
+
from nitric.context import HttpContext
66
+
67
+
publicApi = api("public")
68
+
uploads = bucket("uploads").allow("write")
71
69
72
-
[Nitric Documentation](https://nitric.io/docs)
70
+
@publicApi.get("/upload")
71
+
asyncdefupload(ctx: HttpContext):
72
+
photo = uploads.file("images/photo.jpg")
73
+
74
+
url =await photo.upload_url()
75
+
76
+
ctx.res.body = {"url": url}
77
+
78
+
Nitric.run()
79
+
```
80
+
81
+
## Learn more
82
+
83
+
Learn more by checking out the [Nitric documentation](https://nitric.io/docs).
84
+
85
+
## Get in touch:
86
+
87
+
- Join us on [Discord](https://nitric.io/chat)
88
+
89
+
- Ask questions in [GitHub discussions](https://github.com/nitrictech/nitric/discussions)
90
+
91
+
- Find us on [Twitter](https://twitter.com/nitric_io)
92
+
93
+
- Send us an [email](mailto:maintainers@nitric.io)
0 commit comments