Skip to content

Commit

Permalink
add server version in /info
Browse files Browse the repository at this point in the history
  • Loading branch information
spacemeowx2 committed Oct 9, 2018
1 parent 0aaf02c commit e1feefc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "switch-lan-play",
"version": "1.0.0",
"version": "1.0.0-alpha.1",
"description": "",
"main": "server.js",
"scripts": {
Expand Down
5 changes: 4 additions & 1 deletion server/src/monitor.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import Koa from 'koa'
import Router, { IRouterContext } from 'koa-router'
import { SLPServer } from './udpserver'
import { join } from 'path'
const pkg = require(join(__dirname, '..', 'package.json'))

export class ServerMonitor {
private router = new Router()
Expand Down Expand Up @@ -34,7 +36,8 @@ export class ServerMonitor {

ctx.type = 'application/json'
ctx.body = {
online: size
online: size,
version: pkg.version
}
}
}

0 comments on commit e1feefc

Please sign in to comment.