Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates ui to web components #4

Merged
merged 3 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading