EML Docs

Maintenance mode

You can use Maintenance to block users from using your launcher. It is recommended to use this class to check for maintenance and block the launcher at the start of the application.

You need to block the launcher by yourself if the maintenance is enabled.

Warning

Maintenance requires an EML AdminTool website to work.

import { Maintenance } from 'eml-lib'

maintenance()

async function maintenance() {
  const maintenance = new Maintenance('https://at.emlproject.com')

  try {
    const isMaintenance = await maintenance.getMaintenance()
  } catch (err) {
    console.error(err)
  }
}

Maintenance constructor

ParameterTypeDescriptionRequired?
urlstringThe URL of your EML AdminTool website.Yes

Maintenance.getMaintenance() method

Get the current Maintenance status from the EML AdminTool.

Returns: Promise<null> - No maintenance • Promise<IMaintenance> - The maintenance information if maintenance is enabled.

Throws: FETCH_ERROR - If the request to the EML AdminTool website fails.