EzBackend - The Server
Overview
The EzBackend is the root EzApp. All other EzApps should be children of the EzBackend, and there should be only one EzBackend per application. A sample meetup app may look something like:
Recommended Setup
We recommend following the instructions in Getting Started
Which creates the following boilerplate
- Sample
- Full Sample
const app = new EzBackend();
//---Plugins---
app.addApp(new EzOpenAPI());
app.addApp(new EzDbUI());
app.addApp(new EzCors());
//---Plugins---
app.start();
import { EzBackend } from "@ezbackend/common";
import { EzOpenAPI } from "@ezbackend/openapi";
import { EzDbUI } from "@ezbackend/db-ui";
import { EzCors } from "@ezbackend/cors";
const app = new EzBackend();
//---Plugins---
app.addApp(new EzOpenAPI());
app.addApp(new EzDbUI());
app.addApp(new EzCors());
//---Plugins---
app.start();
This basic boilerplate comes with three plugins to aid development
Plugin | Description | Notes |
---|---|---|
An all in one interface for 1. Looking at your API endpoints 2. Managing your database 3. Testing your API endpoints | Requires EzOpenAPI plugin to be used as well | |
Automatically generates documentation for your backend | ||
Plugin for managing CORS, by default accepts requests from anywhere | Make sure to change cors settings before deployment |
Barebones
If you just want a barebones application, you can use the following
import { EzBackend } from "@ezbackend/common";
const app = new EzBackend();
app.start();
caution
However, this barebones application does not have alot of the functionality that EzBackend provides to make your life easier.