Skip to content

Commit

Permalink
use commonjs consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Jun 11, 2024
1 parent 9f48ef7 commit d1ad0a1
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pages/api/authorize.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion pages/api/deleteFact.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
2 changes: 1 addition & 1 deletion pages/api/facts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down
2 changes: 1 addition & 1 deletion pages/api/leaderboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion pages/api/resumeGame.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion pages/api/startGame.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion pages/api/tell.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion pages/api/verifySolutionForLevel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit d1ad0a1

Please sign in to comment.