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
Now that you have an API defined, we can test it locally. You can do this using `nitric start` and make a request to the API either through the [Nitric Dashboard](/get-started/foundations/projects/local-development#local-dashboard) or another HTTP client like cURL.
220
-
221
-
```bash
222
-
curl -X POST http://localhost:4001/prompt -d "What is Nitric?"
223
-
```
224
-
225
-
This should produce an output similar to:
243
+
Now that we have the Websocket defined, we can test it locally. You can do this using `nitric start` and connecting to the websocket through either the [Nitric Dashboard](/get-started/foundations/projects/local-development#local-dashboard) or another Websocket client. Once connected, you can send a message with a prompt to the model. Sending a prompt like "What is Nitric?" should produce an output similar to:
226
244
227
245
```text
228
-
Nitric is a cloud-agnostic framework designed to aid developers in building full cloud applications, including infrastructure. It is a declarative cloud framework with common resources like APIs, websockets, databases, queues, topics, buckets, and more. The framework provides tools for locally simulating a cloud environment, to allow an application to be tested locally, and it makes it possible to interact with resources at runtime. It is a lightweight and flexible framework that allows developers to structure their projects according to their preferences and needs. Nitric is not a replacement for IaC tools like Terraform but rather introduces a method of bringing developer self-service for infrastructure directly into the developer application. Nitric can be augmented through use of tools like Pulumi or Terraform and even be fully customized using such tools. The framework supports multiple programming languages, and its default deployment engines are built with Pulumi. Nitric provides tools for defining services in your project's `nitric.yaml` file, and each service can be run independently, allowing your app to scale and manage different workloads efficiently. Services are the heart of Nitric apps, they're the entrypoints to your code. They can serve as APIs, websockets, schedule handlers, subscribers and a lot more.
246
+
Nitric is a cloud-agnostic framework designed to aid developers in building full cloud applications, including infrastructure.
229
247
```
230
248
231
249
## Get ready for deployment
@@ -258,6 +276,8 @@ nitric stack new dev aws
258
276
259
277
Update the stack file `nitric.dev.yaml` with the appropriate AWS region and memory allocation to handle the model:
260
278
279
+
<Note>WebSockets are supported across all of AWS regions</Note>
280
+
261
281
```yaml title:nitric.dev.yaml
262
282
provider: nitric/aws@1.14.0
263
283
region: us-east-1
@@ -280,11 +300,7 @@ We can then deploy using the following command:
280
300
nitric up
281
301
```
282
302
283
-
Testing on AWS will be the same as we did locally, we'll just use cURL to make a request to the API URL that was outputted at the end of the deployment.
284
-
285
-
```bash
286
-
curl -x POST {your AWS endpoint URL here}/prompt -d "What is Nitric?"
287
-
```
303
+
Testing on AWS we'll need to use a Websocket client or the AWS portal. You can verify it in the same way as locally by connecting to the websocket and sending a message with a prompt for the model.
288
304
289
305
Once you're finished querying the model, you can destroy the deployment using `nitric down`.
0 commit comments