src/Http/Router.php
public function register() {
		if ( ! $this->vendor ) {
			throw new VendorNotSetException;
		}

		if ( ! $this->version ) {
			throw new VersionNotSetException;
		}

		foreach ( $this->endpoints as $endpoint ) {
			register_rest_route(
				$this->get_namespace(),
				$endpoint->get_route(),
				$endpoint->get_options()
			);
		}
	}
public function register() {
		if ( ! $this->vendor ) {
			throw new VendorNotSetException;
		}

		if ( ! $this->version ) {
			throw new VersionNotSetException;
		}

		foreach ( $this->endpoints as $endpoint ) {
			register_rest_route(
				$this->get_namespace(),
				$endpoint->get_route(),
				$endpoint->get_options()
			);
		}
	}
public function register ( ) { if ( ! $ this -> vendor ) { throw new VendorNotSetException ; } if ( ! $ this -> version ) { throw new VersionNotSetException ; } foreach ( $ this -> endpoints as $ endpoint ) { register_rest_route ( $ this -> get_namespace ( ) , $ endpoint -> get_route ( ) , $ endpoint -> get_options ( ) ) ; } }
Registers all of the routes with the WP-API.

Runs on the `rest_api_init` hook. Registers all of the routes loaded
on the router into the WordPress REST API.

@throws VendorNotSetException
@throws VersionNotSetException
Registers all of the routes with the WP - API .