Skip to content
This repository has been archived by the owner on Dec 21, 2024. It is now read-only.

Commit

Permalink
chore: clean up html5 demo (#550)
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFlurry committed Oct 2, 2024
1 parent 294b466 commit 7dee61a
Show file tree
Hide file tree
Showing 37 changed files with 3,125 additions and 3,581 deletions.
File renamed without changes.
37 changes: 37 additions & 0 deletions examples/html5-node/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Sandbox

## Quickstart Tutorial

View the documentation [here](https://rivet.gg/docs/html5/tutorials/quickstart).

## Prerequisites

- Rivet CLI
- NodeJS
- Open ports: 8080 (client), 7777 (game server), 6420 (Rivet)

## Instructions

### Develop

```
npm install
npm run dev
```

Open [http://127.0.0.1:8080](http://127.0.0.1:8080).

### Deploy

```
rivet login
rivet deploy prod
```

#### Connecting

In the client served by `npm run dev`:

1. Run `rivet backend get-endpoint prod` and copy this value to the _Endpoint_ field.
2. Run `rivet backend get-current-version prod` and copy this value to the _Game Version_ field.

15 changes: 15 additions & 0 deletions examples/html5-node/game_server.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:20-alpine
RUN adduser -D server
WORKDIR /app

COPY package.json package.json
COPY packages/rivet-sdk ./packages/rivet-sdk
COPY packages/game-server ./packages/game-server
WORKDIR /app/packages/game-server
RUN npm install --frozen-lockfile && npm run build

RUN chown -R server:server /app
USER server
EXPOSE 7777

CMD ["node", "dist/index.js"]
Loading

0 comments on commit 7dee61a

Please sign in to comment.