From 03e1e7d4409339c4083cd535cb2dc7140e709e45 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sun, 27 Mar 2016 00:38:47 +0100 Subject: [PATCH] Added status page support --- server/auth.coffee | 2 +- server/index.coffee | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/server/auth.coffee b/server/auth.coffee index 239e99f..3b27f50 100644 --- a/server/auth.coffee +++ b/server/auth.coffee @@ -29,7 +29,7 @@ loggedin = false exports.middleware = -> (req, res, next) -> cookies = new Cookies( req, res ) - return next() if req.path.match(/^\/css|^\/js|^\/fonts|^\/Sprites|^\/tiers|^\/pokemon|^\/replays\/\b/) + return next() if req.path.match(/^\/css|^\/js|^\/fonts|^\/Sprites|^\/tiers|^\/pokemon|^\/ping|^\/replays\/\b/) return next() if req.path.match(/^\/leaderboard/) # add some proper site authentication later instead authenticate req, (body) -> diff --git a/server/index.coffee b/server/index.coffee index 4db9dfe..92d73f4 100644 --- a/server/index.coffee +++ b/server/index.coffee @@ -125,6 +125,8 @@ CLIENT_VERSION = assets.getVersion() species = generations.GenerationJSON[generations.DEFAULT_GENERATION.toUpperCase()].SpeciesData res.json(formes: formes) + app.get '/ping', (req, res) -> + res.json(200, {response: "pong"}) app.get '/pokeuse/json', (req, res) -> user= req.user