Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PORT=3001
NETWORK=testnet
MAINTENANCE=
MAINTENANCE= # optional, should be string of error message like "update in progress, try later"
HUB_DATABASE_URL=mysql://...
SEQ_DATABASE_URL=mysql://...
RELAYER_PK=0x123...
Expand Down
4 changes: 1 addition & 3 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ import { name, version } from '../package.json';
const router = express.Router();
const SNAPSHOT_ENV = process.env.NETWORK || 'testnet';

const maintenanceMsg = 'update in progress, try later';

router.post(
'/',
duplicateRequestPreventor,
async (req: Request, res: Response, next: NextFunction) => {
if (process.env.MAINTENANCE) return sendError(res, maintenanceMsg, 503);
if (process.env.MAINTENANCE) return sendError(res, process.env.MAINTENANCE, 503);
try {
const result = await typedData(req);
res.json(result);
Expand Down
Loading