diff --git a/pages/api/authorize.js b/pages/api/authorize.js index 3989f2d..3e13e54 100644 --- a/pages/api/authorize.js +++ b/pages/api/authorize.js @@ -27,7 +27,7 @@ const AuthorizeParams = new Archetype({ }).compile('AuthorizeParams'); -export default async function handler(req, res) { +module.exports = async function handler(req, res) { try { const params = new AuthorizeParams(req.query); const authorized = await oso.authorize( diff --git a/pages/api/deleteFact.js b/pages/api/deleteFact.js index 52d656a..aaa3bfe 100644 --- a/pages/api/deleteFact.js +++ b/pages/api/deleteFact.js @@ -40,7 +40,7 @@ const DeleteFactParams = new Archetype({ } }).compile('DeleteFactParams'); -export default async function handler(req, res) { +module.exports = async function handler(req, res) { try { const params = new DeleteFactParams(req.body); if (params.factType === 'role') { diff --git a/pages/api/facts.js b/pages/api/facts.js index a0bb269..b0bd307 100644 --- a/pages/api/facts.js +++ b/pages/api/facts.js @@ -14,7 +14,7 @@ const FactsParams = new Archetype({ } }).compile('FactsParams'); -export default async function handler(req, res) { +module.exports = async function handler(req, res) { try { const params = new FactsParams(req.body); const facts = []; diff --git a/pages/api/leaderboard.js b/pages/api/leaderboard.js index cef8235..dfcd0ef 100644 --- a/pages/api/leaderboard.js +++ b/pages/api/leaderboard.js @@ -3,7 +3,7 @@ const Player = require('../../db/player'); const connect = require('../../db/connect'); -export default async function handler(req, res) { +module.exports = async function handler(req, res) { try { await connect(); diff --git a/pages/api/resumeGame.js b/pages/api/resumeGame.js index 5782217..bc55d00 100644 --- a/pages/api/resumeGame.js +++ b/pages/api/resumeGame.js @@ -11,7 +11,7 @@ const ResumeGameParams = new Archetype({ } }).compile('ResumeGameParams'); -export default async function handler(req, res) { +module.exports = async function handler(req, res) { try { const { sessionId } = new ResumeGameParams(req.query); diff --git a/pages/api/startGame.js b/pages/api/startGame.js index bc3c86e..029a8b1 100644 --- a/pages/api/startGame.js +++ b/pages/api/startGame.js @@ -20,7 +20,7 @@ const StartGameParams = new Archetype({ } }).compile('StartGameParams'); -export default async function handler(req, res) { +module.exports = async function handler(req, res) { try { const { sessionId, name, email } = new StartGameParams(req.body); diff --git a/pages/api/tell.js b/pages/api/tell.js index bbbae0b..290a732 100644 --- a/pages/api/tell.js +++ b/pages/api/tell.js @@ -40,7 +40,7 @@ const TellParams = new Archetype({ } }).compile('TellParams'); -export default async function handler(req, res) { +module.exports = async function handler(req, res) { try { const params = new TellParams(req.body); assert.ok( diff --git a/pages/api/verifySolutionForLevel.js b/pages/api/verifySolutionForLevel.js index b83d7ad..2359886 100644 --- a/pages/api/verifySolutionForLevel.js +++ b/pages/api/verifySolutionForLevel.js @@ -23,7 +23,7 @@ const constraintsByLevel = require('../../levels').map(level => level.constraint const parByLevel = require('../../levels').map(level => level.par); -export default async function handler(req, res) { +module.exports = async function handler(req, res) { try { const { sessionId, level } = new VerifySolutionForLevelParams(req.body);