Compare commits

...

38 Commits

Author SHA1 Message Date
dependabot[bot] 64efacaf39 Bump dotenv from 17.4.1 to 17.4.2
Bumps [dotenv](https://github.com/motdotla/dotenv) from 17.4.1 to 17.4.2.
- [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/motdotla/dotenv/compare/v17.4.1...v17.4.2)

---
updated-dependencies:
- dependency-name: dotenv
  dependency-version: 17.4.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-17 08:27:23 +10:00
dependabot[bot] f124278452 Bump dotenv from 17.3.1 to 17.4.1
Bumps [dotenv](https://github.com/motdotla/dotenv) from 17.3.1 to 17.4.1.
- [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/motdotla/dotenv/compare/v17.3.1...v17.4.1)

---
updated-dependencies:
- dependency-name: dotenv
  dependency-version: 17.4.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-07 22:02:29 +10:00
dependabot[bot] ba1bfeb3a9 Bump sequelize from 6.37.7 to 6.37.8
Bumps [sequelize](https://github.com/sequelize/sequelize) from 6.37.7 to 6.37.8.
- [Release notes](https://github.com/sequelize/sequelize/releases)
- [Changelog](https://github.com/sequelize/sequelize/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sequelize/sequelize/compare/v6.37.7...v6.37.8)

---
updated-dependencies:
- dependency-name: sequelize
  dependency-version: 6.37.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-03 08:47:09 +11:00
dependabot[bot] 60224fa348 Bump mariadb from 3.5.1 to 3.5.2
Bumps [mariadb](https://github.com/mariadb-corporation/mariadb-connector-nodejs) from 3.5.1 to 3.5.2.
- [Release notes](https://github.com/mariadb-corporation/mariadb-connector-nodejs/releases)
- [Changelog](https://github.com/mariadb-corporation/mariadb-connector-nodejs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mariadb-corporation/mariadb-connector-nodejs/compare/3.5.1...3.5.2)

---
updated-dependencies:
- dependency-name: mariadb
  dependency-version: 3.5.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-03 08:45:06 +11:00
dependabot[bot] 38aaefbb3f Bump mariadb from 3.4.5 to 3.5.1
Bumps [mariadb](https://github.com/mariadb-corporation/mariadb-connector-nodejs) from 3.4.5 to 3.5.1.
- [Release notes](https://github.com/mariadb-corporation/mariadb-connector-nodejs/releases)
- [Changelog](https://github.com/mariadb-corporation/mariadb-connector-nodejs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mariadb-corporation/mariadb-connector-nodejs/compare/3.4.5...3.5.1)

---
updated-dependencies:
- dependency-name: mariadb
  dependency-version: 3.5.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-01 09:50:49 +11:00
dependabot[bot] 8a62e561e3 Bump nodemon from 3.1.11 to 3.1.14
Bumps [nodemon](https://github.com/remy/nodemon) from 3.1.11 to 3.1.14.
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](https://github.com/remy/nodemon/compare/v3.1.11...v3.1.14)

---
updated-dependencies:
- dependency-name: nodemon
  dependency-version: 3.1.14
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-01 09:47:09 +11:00
dependabot[bot] 55c5b53de4 Bump cors from 2.8.5 to 2.8.6
Bumps [cors](https://github.com/expressjs/cors) from 2.8.5 to 2.8.6.
- [Release notes](https://github.com/expressjs/cors/releases)
- [Changelog](https://github.com/expressjs/cors/blob/master/HISTORY.md)
- [Commits](https://github.com/expressjs/cors/compare/v2.8.5...v2.8.6)

---
updated-dependencies:
- dependency-name: cors
  dependency-version: 2.8.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-20 09:15:50 +11:00
dependabot[bot] 37abf4e2b4 Bump dotenv from 17.2.3 to 17.3.1
Bumps [dotenv](https://github.com/motdotla/dotenv) from 17.2.3 to 17.3.1.
- [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/motdotla/dotenv/compare/v17.2.3...v17.3.1)

---
updated-dependencies:
- dependency-name: dotenv
  dependency-version: 17.3.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-20 09:12:02 +11:00
dependabot[bot] d2b1433846 Bump socket.io from 4.8.1 to 4.8.3
Bumps [socket.io](https://github.com/socketio/socket.io) from 4.8.1 to 4.8.3.
- [Release notes](https://github.com/socketio/socket.io/releases)
- [Changelog](https://github.com/socketio/socket.io/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/socket.io/compare/socket.io@4.8.1...socket.io@4.8.3)

---
updated-dependencies:
- dependency-name: socket.io
  dependency-version: 4.8.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-02 18:37:53 +11:00
Kayne Ruse 9935bc9c2f Version bump 2025-12-10 11:58:44 +11:00
Kayne Ruse e7b631c9c5 Updated syntax for docker and CI files 2025-12-10 10:19:41 +11:00
Kayne Ruse b6bf405a71 Updated dependencies 2025-12-10 09:11:21 +11:00
dependabot[bot] cf40c7a92c Bump express from 5.1.0 to 5.2.0
Bumps [express](https://github.com/expressjs/express) from 5.1.0 to 5.2.0.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/v5.1.0...v5.2.0)

---
updated-dependencies:
- dependency-name: express
  dependency-version: 5.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-07 16:20:18 +11:00
dependabot[bot] bddff784b7 Bump nodemon from 3.1.10 to 3.1.11
Bumps [nodemon](https://github.com/remy/nodemon) from 3.1.10 to 3.1.11.
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](https://github.com/remy/nodemon/compare/v3.1.10...v3.1.11)

---
updated-dependencies:
- dependency-name: nodemon
  dependency-version: 3.1.11
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-25 08:06:30 +11:00
dependabot[bot] bcd09a58bc Bump dotenv from 17.2.2 to 17.2.3
Bumps [dotenv](https://github.com/motdotla/dotenv) from 17.2.2 to 17.2.3.
- [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/motdotla/dotenv/compare/v17.2.2...v17.2.3)

---
updated-dependencies:
- dependency-name: dotenv
  dependency-version: 17.2.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-12 22:23:47 +11:00
Kayne Ruse 47de3e4330 Updated dependencies 2025-09-18 10:46:22 +10:00
Kayne Ruse db66d61abe Bump dependencies 2025-09-10 14:06:56 +10:00
dependabot[bot] f5fceb5c4e Bump dotenv from 17.2.1 to 17.2.2
Bumps [dotenv](https://github.com/motdotla/dotenv) from 17.2.1 to 17.2.2.
- [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/motdotla/dotenv/compare/v17.2.1...v17.2.2)

---
updated-dependencies:
- dependency-name: dotenv
  dependency-version: 17.2.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 13:04:24 +10:00
Kayne Ruse b4b490dc6f Experimenting with dependabot 2025-09-09 18:56:40 +10:00
Kayne Ruse 496048f62b Updated dependencies 2025-07-26 03:56:40 +10:00
Ratstail91 2e8c3f98ca Fully tested the remote database
Updated docker base image
2024-05-03 09:27:29 +10:00
Ratstail91 582c0b453c UNTESTED: Updated all dependencies 2024-05-03 07:08:09 +10:00
Ratstail91 9db6dbf63b UNTESTED: Added database port as a configurable option
Also updated license field in package.json
2024-04-15 21:03:23 +10:00
Ratstail91 3700372e92 Updated dependencies 2024-04-15 17:12:04 +10:00
Ratstail91 416ab2f3f9 Updated libraries, docker engine version, docker distro version 2023-12-23 23:55:26 +11:00
Kayne Ruse 1b5cbaea17 Docker behaviour changed, fixed 2023-06-26 23:20:34 +10:00
Kayne Ruse 0f2b8d3f52 Updated dependencies, bumped patch version 2023-06-26 23:06:15 +10:00
Kayne Ruse 88c2239fdb Updated dependencies 2023-05-29 07:56:13 +10:00
Kayne Ruse b5f9d0a7fc Updated dependencies 2023-05-03 21:32:31 +10:00
Kayne Ruse 1ec29e4519 Updated depencencies, bumped version 2023-03-25 01:50:32 +11:00
Kayne Ruse a15c43b3d0 Updated dependencies 2023-03-19 02:53:17 +11:00
Kayne Ruse 9bc96bdb5f Updated dependencies 2023-02-21 09:30:15 +11:00
Kayne Ruse 4bdcee11ea Updated dependencies, License 2023-01-12 08:08:34 +11:00
Kayne Ruse e1cd1ec001 Bumped version number 2023-01-04 12:57:13 +00:00
Kayne Ruse e8a9a79687 Switched to a slim docker distro 2023-01-04 23:51:49 +11:00
Kayne Ruse 7d628be826 Updated libraries 2022-12-31 19:03:50 +00:00
Kayne Ruse 7a42ab3108 Updated dependencies 2022-11-29 05:06:21 +00:00
Kayne Ruse ec573e1074 Updated dependencies 2022-11-13 02:17:33 +00:00
12 changed files with 1137 additions and 1963 deletions
+3 -1
View File
@@ -2,7 +2,9 @@ WEB_PORT=3300
WEB_ORIGIN=http://localhost:3001 WEB_ORIGIN=http://localhost:3001
DB_HOSTNAME=database DB_HOSTNAME=localhost
DB_PORTNAME=3306
DB_DATABASE=chat DB_DATABASE=chat
DB_USERNAME=chat DB_USERNAME=chat
DB_PASSWORD=blastoise DB_PASSWORD=blastoise
+10
View File
@@ -0,0 +1,10 @@
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
+8 -6
View File
@@ -5,19 +5,21 @@ on:
push: push:
tags: tags:
- v1.* - v1.*
workflow_dispatch:
jobs: jobs:
push_to_registry: push_to_registry:
name: Push Docker Image to Docker Hub name: Push Docker Image to Docker Hub
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check Out The Repo - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v5
- name: Setup QEMU - name: Setup QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v3
- name: Get Smart Tag - name: Get Smart Tag
id: prepare id: prepare
@@ -26,13 +28,13 @@ jobs:
docker_image: krgamestudios/chat-server docker_image: krgamestudios/chat-server
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v1 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push to Docker Hub - name: Push to Docker Hub
uses: docker/build-push-action@v2 uses: docker/build-push-action@v6
with: with:
push: true push: true
tags: ${{ steps.prepare.outputs.tag }} tags: ${{ steps.prepare.outputs.tag }}
+4 -3
View File
@@ -1,7 +1,8 @@
FROM node:18
FROM node:22-bookworm-slim
WORKDIR "/app" WORKDIR "/app"
COPY package*.json ./ COPY package*.json /app
RUN npm install --production RUN npm install --omit=dev
COPY . /app COPY . /app
EXPOSE 3300 EXPOSE 3300
USER node USER node
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright (c) 2021 Kayne Ruse, KR Game Studios Copyright (c) 2021-2023 Kayne Ruse, KR Game Studios
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
+1 -1
View File
@@ -6,7 +6,7 @@ This server is available via docker hub at krgamestudios/chat-server.
# Setup # Setup
There are multiple ways to run this app - it can run on it's own via `npm start` (for production) or `npm run dev` (for development). it can also run inside docker using `docker-compose up --build` - run `node configure-script.js` to generate docker-compose.yml and startup.sql. There are multiple ways to run this app - it can run on it's own via `npm start` (for production) or `npm run dev` (for development). it can also run inside docker using `docker compose up --build` - run `node configure-script.js` to generate docker-compose.yml and startup.sql.
To generate an authorization token, use [auth-server](https://github.com/krgamestudios/auth-server). A public-facing development auth-server is available here (tokens are valid for 10 minutes): To generate an authorization token, use [auth-server](https://github.com/krgamestudios/auth-server). A public-facing development auth-server is available here (tokens are valid for 10 minutes):
+56 -27
View File
@@ -33,6 +33,25 @@ const question = (prompt, def = null) => {
const appWebOrigin = await question('Web Origin', `https://example.com`); //TODO: clean these up properly const appWebOrigin = await question('Web Origin', `https://example.com`); //TODO: clean these up properly
const appPort = await question('App Port', '3300'); const appPort = await question('App Port', '3300');
//configure the database address
let dbLocation = '';
while (typeof dbLocation != 'string' || /^[le]/i.test(dbLocation[0]) == false) {
dbLocation = await question('[l]ocal or [e]xternal database?');
}
let appDBHost = '';
let appDBPort = '';
if (/^[l]/i.test(dbLocation[0])) {
appDBHost = 'database';
appDBPort = '3306';
}
else {
appDBHost = await question('DB Host');
appDBPort = await question('DB Port', '3306');
}
//configure the database account
const appDBUser = await question('DB User', appName); const appDBUser = await question('DB User', appName);
const appDBPass = await question('DB Pass', 'blastoise'); const appDBPass = await question('DB Pass', 'blastoise');
const dbRootPass = await question('DB Root Pass'); const dbRootPass = await question('DB Root Pass');
@@ -43,38 +62,42 @@ const question = (prompt, def = null) => {
//generate the files //generate the files
const ymlfile = ` const ymlfile = `
version: '3'
services: services:
${appName}: ${appName}:
build: build:
context: . context: .
ports: ports:
- "${appPort}" - ${appPort}
labels: labels:
- "traefik.enable=true" - traefik.enable=true
- "traefik.http.routers.${appName}router.rule=Host(\`${appWebAddress}\`)" - traefik.http.routers.${appName}router.rule=Host(\`${appWebAddress}\`)
- "traefik.http.routers.${appName}router.entrypoints=websecure" - traefik.http.routers.${appName}router.entrypoints=websecure
- "traefik.http.routers.${appName}router.tls.certresolver=myresolver" - traefik.http.routers.${appName}router.tls.certresolver=myresolver
- "traefik.http.routers.${appName}router.service=${appName}service@docker" - traefik.http.routers.${appName}router.service=${appName}service@docker
- "traefik.http.services.${appName}service.loadbalancer.server.port=${appPort}" - traefik.http.services.${appName}service.loadbalancer.server.port=${appPort}
environment: environment:
- WEB_PORT=${appPort} - WEB_PORT=${appPort}
- WEB_ORIGIN=${appWebOrigin} - WEB_ORIGIN=${appWebOrigin}
- DB_HOSTNAME=database - DB_HOSTNAME=${appDBHost}
- DB_PORTNAME=${appDBPort}
- DB_DATABASE=${appName} - DB_DATABASE=${appName}
- DB_USERNAME=${appDBUser} - DB_USERNAME=${appDBUser}
- DB_PASSWORD=${appDBPass} - DB_PASSWORD=${appDBPass}
- DB_TIMEZONE=Australia/Sydney - DB_TIMEZONE=Australia/Sydney
- SECRET_ACCESS=${appSecretAccess} - SECRET_ACCESS=${appSecretAccess}
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
networks: networks:
- app-network - app-network${ appDBHost != 'database' ? '' : `
depends_on: depends_on:
- database - database
database: database:
image: mariadb:latest image: mariadb:latest
environment: environment:
MYSQL_DATABASE: ${appName} MYSQL_DATABASE: ${appName}
MYSQL_TCP_PORT: ${appDBPort}
MYSQL_USER: ${appDBUser} MYSQL_USER: ${appDBUser}
MYSQL_PASSWORD: ${appDBPass} MYSQL_PASSWORD: ${appDBPass}
MYSQL_ROOT_PASSWORD: ${dbRootPass} MYSQL_ROOT_PASSWORD: ${dbRootPass}
@@ -83,37 +106,43 @@ services:
volumes: volumes:
- ./mysql:/var/lib/mysql - ./mysql:/var/lib/mysql
- ./startup.sql:/docker-entrypoint-initdb.d/startup.sql:ro - ./startup.sql:/docker-entrypoint-initdb.d/startup.sql:ro
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro`}
traefik_${appName}: traefik_${appName}:
container_name: ${appName}_traefik container_name: ${appName}_traefik
image: "traefik:v2.4" image: traefik:v2.10
container_name: "traefik" container_name: traefik
command: command:
- "--log.level=ERROR" - --log.level=ERROR
- "--api.insecure=false" - --api.insecure=false
- "--providers.docker=true" - --providers.docker=true
- "--providers.docker.exposedbydefault=false" - --providers.docker.exposedbydefault=false
- "--entrypoints.websecure.address=:443" - --entrypoints.websecure.address=:443
- "--certificatesresolvers.myresolver.acme.tlschallenge=true" - --certificatesresolvers.myresolver.acme.tlschallenge=true
- "--certificatesresolvers.myresolver.acme.email=${supportEmail}" - --certificatesresolvers.myresolver.acme.email=${supportEmail}
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json" - --certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json
ports: ports:
- "80:80" - 80:80
- "443:443" - 443:443
volumes: volumes:
- "./letsencrypt:/letsencrypt" - ./letsencrypt:/letsencrypt
- "/var/run/docker.sock:/var/run/docker.sock:ro" - /var/run/docker.sock:/var/run/docker.sock:ro
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
networks: networks:
- app-network - app-network
networks: networks:
app-network: app-network:
driver: bridge driver: bridge
`; `;
const dockerfile = ` const dockerfile = `
FROM node:18 FROM node:22-bookworm-slim
WORKDIR "/app" WORKDIR "/app"
COPY package*.json ./ COPY package*.json ./
RUN npm install --production RUN npm install --omit=dev
COPY . /app COPY . /app
EXPOSE ${appPort} EXPOSE ${appPort}
USER node USER node
+1038 -1908
View File
File diff suppressed because it is too large Load Diff
+10 -10
View File
@@ -1,6 +1,6 @@
{ {
"name": "chat-server", "name": "chat-server",
"version": "1.3.1", "version": "1.5.5",
"description": "An API centric chat server. Uses Sequelize and mariaDB by default.", "description": "An API centric chat server. Uses Sequelize and mariaDB by default.",
"main": "server/server.js", "main": "server/server.js",
"scripts": { "scripts": {
@@ -13,21 +13,21 @@
"url": "git+https://github.com/krgamestudios/chat-server.git" "url": "git+https://github.com/krgamestudios/chat-server.git"
}, },
"author": "Kayne Ruse", "author": "Kayne Ruse",
"license": "ISC", "license": "Zlib",
"bugs": { "bugs": {
"url": "https://github.com/krgamestudios/chat-server/issues" "url": "https://github.com/krgamestudios/chat-server/issues"
}, },
"homepage": "https://github.com/krgamestudios/chat-server#readme", "homepage": "https://github.com/krgamestudios/chat-server#readme",
"dependencies": { "dependencies": {
"cors": "^2.8.5", "cors": "^2.8.6",
"dotenv": "^16.0.1", "dotenv": "^17.4.2",
"express": "^4.17.1", "express": "^5.2.1",
"jsonwebtoken": "^8.5.1", "jsonwebtoken": "^9.0.3",
"mariadb": "^3.0.1", "mariadb": "^3.5.2",
"sequelize": "^6.6.5", "sequelize": "^6.37.8",
"socket.io": "^4.1.3" "socket.io": "^4.8.3"
}, },
"devDependencies": { "devDependencies": {
"nodemon": "^2.0.12" "nodemon": "^3.1.14"
} }
} }
+1 -2
View File
@@ -2,11 +2,10 @@ const Sequelize = require('sequelize');
const sequelize = new Sequelize(process.env.DB_DATABASE, process.env.DB_USERNAME, process.env.DB_PASSWORD, { const sequelize = new Sequelize(process.env.DB_DATABASE, process.env.DB_USERNAME, process.env.DB_PASSWORD, {
host: process.env.DB_HOSTNAME, host: process.env.DB_HOSTNAME,
port: process.env.DB_PORTNAME,
dialect: 'mariadb', dialect: 'mariadb',
timezone: process.env.DB_TIMEZONE, timezone: process.env.DB_TIMEZONE,
logging: process.env.DB_LOGGING ? console.log : false logging: process.env.DB_LOGGING ? console.log : false
}); });
sequelize.sync();
module.exports = sequelize; module.exports = sequelize;
+2 -1
View File
@@ -31,7 +31,7 @@ app.use('/admin', require('./admin'));
require('./chat')(io.of('/chat')); require('./chat')(io.of('/chat'));
//error on access //error on access
app.get('*', (req, res) => { app.get('/{*any}', (req, res) => {
res.redirect('https://github.com/krgamestudios/chat-server'); res.redirect('https://github.com/krgamestudios/chat-server');
}); });
@@ -39,4 +39,5 @@ app.get('*', (req, res) => {
server.listen(process.env.WEB_PORT || 3300, async (err) => { server.listen(process.env.WEB_PORT || 3300, async (err) => {
await database.sync(); await database.sync();
console.log(`listening to localhost:${process.env.WEB_PORT || 3300}`); console.log(`listening to localhost:${process.env.WEB_PORT || 3300}`);
console.log(`database located at ${process.env.DB_HOSTNAME || '<default>'}:${process.env.DB_PORTNAME || '<default>'}`);
}); });
+2 -2
View File
@@ -1,4 +1,4 @@
#use this while debugging #use this while debugging
CREATE DATABASE IF NOT EXISTS chat; CREATE DATABASE chat;
CREATE USER IF NOT EXISTS 'chat'@'%' IDENTIFIED BY 'blastoise'; CREATE USER 'chat'@'%' IDENTIFIED BY 'blastoise';
GRANT ALL PRIVILEGES ON chat.* TO 'chat'@'%'; GRANT ALL PRIVILEGES ON chat.* TO 'chat'@'%';