mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 12:02:13 +00:00
don't redirect json calls to /splash.html
This commit is contained in:
parent
c15d272e12
commit
e0f1d74541
2 changed files with 4 additions and 0 deletions
|
|
@ -78,6 +78,9 @@ mongo_store = new MongoStore {url: process.env.NODE_DB_URI}, ->
|
|||
|
||||
#show splash page for newcomers
|
||||
.use (req, res, next) ->
|
||||
# This was an API call, not a page load
|
||||
return next() if req.is('json')
|
||||
|
||||
if !req.session.userId? and !req.query?.play?
|
||||
res.redirect('/splash.html')
|
||||
else
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ module.exports = (expressApp, root, derby) ->
|
|||
res.send(200, deprecatedMessage)
|
||||
|
||||
# New API
|
||||
# test with `curl -X POST -H "Content-Type:application/json" localhost:3000/users/{uid}/tasks/productivity/up`
|
||||
expressApp.post '/users/:uid/tasks/:taskId/:direction', (req, res) ->
|
||||
{uid, taskId, direction} = req.params
|
||||
{title, service, icon} = req.body
|
||||
|
|
|
|||
Loading…
Reference in a new issue