pesde primiti_ve / luau_html

middleware

middleware is used to determine if the page will be served.

types

type middleware = {
	guid: number,
	callback: (string) -> (boolean),
}

functions

middleware.new(priority, callback)

  • priority is a number that determines the order in which the middleware will be run.
  • callback is a function that takes the page data in and returns a boolean, which determines if the page will be served.
  • this returns a number which is the guid of the middleware object.

middleware.get(guid)

  • guid is a number, and it should be the guid of the middleware object you are trying to get.
  • this can return nil!

middleware.remove(guid)

  • guid is a number, and it should be the guid of the middleware object you are trying to remove.
  • this does not return anything.

middleware.getAll()

  • this returns a list of all active middleware.