2
1
mirror of https://github.com/s00500/nodeMessageBoard.git synced 2024-11-21 08:10:53 +00:00

Update server.js

This commit is contained in:
Lukas Bachschwell 2016-03-10 15:57:03 +01:00
parent b0f4e94a1d
commit 7accd22dc8

View File

@ -34,7 +34,8 @@ function startServer(route,handle,debug)
{
db('messages').size(); //call this once to establish the db if there is nothing in the json file
if(db('messages').size() == 0)db('messages').push({ numberString: "",number: "+43 681 2033 4015", time: "now", message: "SMS MessageBoard",color: 0 });
var mynumber = config('mainConfig').chain().find({ param: 'mynumber' }).value()['value'];
if(db('messages').size() == 0)db('messages').push({ numberString: "",number: mynumber, time: "now", message: "SMS MessageBoard",color: 0 });
// on request event
function onRequest(request, response) {