Update default ENDPOINT and add /status to API

This commit is contained in:
Sage Vaillancourt 2023-12-17 19:06:53 -05:00
parent 5e21219d00
commit 421c329d94
4 changed files with 13 additions and 7 deletions

8
package-lock.json generated
View File

@ -16195,16 +16195,16 @@
}
},
"node_modules/typescript": {
"version": "5.0.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz",
"integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==",
"version": "4.9.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
"peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=12.20"
"node": ">=4.2.0"
}
},
"node_modules/unbox-primitive": {

View File

@ -1,3 +1,5 @@
import packageJSON from './package.json' with { type: "json" }
import { textFromBoard } from './src/logic.js'
import { Board } from './src/backend.js';
@ -9,6 +11,10 @@ const port = process.env.PORT || 4001;
const app = express();
app.get('/status', (req, res) => {
res.send('OK. Version: ' + packageJSON.version + '\n')
})
const server = http.createServer(app);
const io = new Server(server, {

View File

@ -37,8 +37,8 @@ ol, ul {
@media (orientation:landscape) {
.game-board .square {
height: 11vh;
width: 11vh;
height: 10vh;
width: 10vh;
}
.demo-board .square {

View File

@ -6,7 +6,7 @@ import Board from './components/Board.js';
import './index.css';
const ENDPOINT = process.env.REACT_APP_QUICKCHESS_API || "https://api.quickchess.win";
const ENDPOINT = process.env.REACT_APP_QUICKCHESS_API || "https://quickchess-api.sagev.space";
class NameForm extends React.Component {
constructor(props) {