# essential-blocks/6.4.1/includes/API/Server.php

Gutenberg Essential Blocks – Page Builder for Gutenberg Blocks &amp; Patterns, version 6.4.1. 30 lines.

- Page: https://pluginprobe.com/plugins/essential-blocks/6.4.1/code/includes/API/Server.php
- Raw: https://pluginprobe.com/plugins/essential-blocks/6.4.1/raw/includes/API/Server.php
- Modified: 2025-05-19T11:07:08+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/essential-blocks/6.4.1/code/includes/API/Server.php#L10-L20`.

```php
<?php

namespace EssentialBlocks\API;

use EssentialBlocks\Traits\HasSingletone;

class Server {
	use HasSingletone;

	public function __construct() {
		add_action( 'rest_api_init', array( $this, 'register_routes' ) );
	}

	public function register_routes() {
		$routes = $this->routes();

		foreach ( $routes as $route ) {
			$route->register();
		}
	}

	public function routes() {
		return array(
			'product'     => Product::get_instance(),
			'post-blocks' => PostBlock::get_instance(),
			'common'      => Common::get_instance(),
		);
	}
}

```
