Skip to content

Commit

Permalink
Merge pull request #4 from deepgram-starters/sr/add-ui
Browse files Browse the repository at this point in the history
updates ui to web components
  • Loading branch information
SandraRodgers committed Jul 28, 2023
2 parents 6e18c5c + 50ebbd5 commit cafeb64
Show file tree
Hide file tree
Showing 47 changed files with 2,991 additions and 16,931 deletions.
20 changes: 0 additions & 20 deletions Starter-01/.dockerignore

This file was deleted.

49 changes: 0 additions & 49 deletions Starter-01/Dockerfile

This file was deleted.

38 changes: 2 additions & 36 deletions Starter-01/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Deepgram Node.js Starter

This sample demonstrates interacting with the Deepgram API from Node.js. It uses the Deepgram Node SDK, and has a React companion application to interact with the Node integration.
This sample demonstrates interacting with the Deepgram API from Node.js. It uses the Deepgram Node SDK, with a javascript client built from web components.

## Sign-up to Deepgram

Expand Down Expand Up @@ -37,42 +37,8 @@ Copy the code from `config.json.example` and create a new file called `config.js

#### Run the application

The `dev` script will run a web and API server concurrently. Once running, you can [access the application in your browser](http://localhost:8080/).
The `dev` script will run a web and API server concurrently. Once running, you can [access the application in your browser](http://localhost:8081/).

```bash
npm run dev
```

### Using Docker

Follow these steps to run the application with docker.

#### Edit the config file

Copy the contents of `config.json.example` and create a new file called `config.json`. Paste in the contents and enter your API key you generated in the [Deepgram console](https://console.deepgram.com/).

```json
{
"dgKey": "api_key"
}
```

#### Useful binary files

You can run the binary `exec.sh` for Mac or Linux, and `exec.ps1` for Windows.

#### Dockerfile

To use the `Dockerfile` to run the application with docker, run the build and run commands as required.

Build the docker image.

```sh
docker build -t deepgram-javascript-01 .
```

Run the docker image.

```sh
docker run --init -p 8080:8080 -p 8080:8080 -it deepgram-javascript-01
```
4 changes: 2 additions & 2 deletions Starter-01/api-server.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const { Deepgram } = require("@deepgram/sdk");
const config = require("./src/config.json");
const config = require("./config.json");
const cors = require("cors");
const express = require("express");
const multer = require("multer");

const appPort = process.env.SERVER_PORT || 8080;
const appPort = process.env.SERVER_PORT || 8081;
const port = process.env.API_PORT || 8080;
const appOrigin = config.appOrigin || `http://localhost:${appPort}`;

Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions Starter-01/deepgram.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
command = "npm install"

[config]
sample = "src/config.json.example"
output = "src/config.json"
sample = "config.json.example"
output = "config.json"

[post-build]
message = "Run `npm run dev` to get up and running."
2 changes: 0 additions & 2 deletions Starter-01/exec.ps1

This file was deleted.

3 changes: 0 additions & 3 deletions Starter-01/exec.sh

This file was deleted.

Loading

0 comments on commit cafeb64

Please sign in to comment.