Skip to content

Commit

Permalink
Merge pull request #15 from lazorfuzz/dev
Browse files Browse the repository at this point in the history
upgrade to node 18
  • Loading branch information
lazorfuzz authored Sep 28, 2024
2 parents 460a905 + 0853492 commit c190a00
Show file tree
Hide file tree
Showing 15 changed files with 10,909 additions and 3,558 deletions.
9 changes: 5 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module",
"allowImportExportEverywhere": false,
"codeFrame": false
},
"extends": "airbnb",
"extends": "airbnb-base",
"rules": {
"max-len": 0,
"no-multi-assign": 0,
Expand All @@ -21,6 +21,7 @@
"no-underscore-dangle": 0,
"comma-dangle": 0,
"no-use-before-define": 0,
"no-console": 0
}
"no-console": 0,
"import/extensions": 0
}
}
48 changes: 48 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: PR Checks

on:
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: npm ci
- name: Build project
run: npm run build

test:
runs-on: ubuntu-latest

services:
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run test
env:
REDIS_HOST: localhost
REDIS_PORT: 6379
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ dist
.jshintignore
.jshintrc
yarn-error.log
config/local.json
config/*-config.json
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ npm install
Build the project:

```
npm build
npm run build
```

Start in dev mode:
```
npm start
npm run start
```

If all goes well, your console should display a message like this:
Expand Down Expand Up @@ -66,3 +66,9 @@ NODE_ENV=production REDIS_ENDPOINT=localhost REDIS_PORT=6379 node dist/server.js

As with keys and certs, you can also add Redis endpoint details to your JSON config files.

### Running with pm2

```
cd dist
NODE_ENV=production pm2 start server.js --name signalbuddy
```
12 changes: 12 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [
["@babel/preset-env", {
"targets": {
"node": "18"
},
"modules": false,
"useBuiltIns": "usage",
"corejs": 3
}]
]
}
8 changes: 5 additions & 3 deletions config/development.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"isDev": true,
"server": {
"port": 8888,
"/* secure */": "/* whether this connects via https */",
Expand All @@ -10,15 +9,18 @@
},
"redis": {
"endpoint": "localhost",
"port": 6379
"port": 6379,
"password": null,
"/* tls */": "/* the tls config passed into tls.connect. See https://nodejs.org/api/tls.html#tls_tls_connect_options_callback */",
"tls": {}
},
"rooms": {
"/* maxClients */": "/* maximum number of clients per room. 0 = no limit */",
"maxClients": 0
},
"stunservers": [
{
"urls": "stun:stun.l.google.com:19302"
"urls": ["stun:stun.l.google.com:19302"]
}
],
"turnservers": [
Expand Down
3 changes: 1 addition & 2 deletions config/production.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"isDev": true,
"server": {
"port": 443,
"secure": true,
Expand All @@ -16,7 +15,7 @@
},
"stunservers": [
{
"urls": "stun:stun.l.google.com:19302"
"urls": ["stun:stun.l.google.com:19302"]
}
],
"turnservers": []
Expand Down
Loading

0 comments on commit c190a00

Please sign in to comment.