Skip to content

503 Service Unavailable

The server is currently unable to handle the request due to temporary overloading or maintenance. Try again later.

Use this when you are intentionally taking the service offline for patching. Tell load balancers you are under maintenance so they can redirect traffic.

import { HttpException, get } from 'shokupan';
export const checkout = get('/checkout', () => {
// Check a global or env flag
if (process.env.MAINTENANCE_MODE === 'true') {
throw new HttpException('Store is closed for maintenance', 503);
}
// ... proceed with checkout
});