arctic-express
v1.6.0
Published
Arctic Express (Arctic) uses ESNext's decorators to simplify backend development.
Downloads
9
Readme
Arctic Express
Arctic Express (Arctic) uses ESNext's decorators to simplify backend development.
Features
Arctic has two main components Models and Routes. These two can be used independently but are made to work together.
- ORM
- Easy Express router creation
- A powerful plugin system
Read the documentation to find out all features of Arctic.
Installation
Arctic is a node module available in the npm registry use npm or yarn to install Arctic and its dependencies.
npm install arctic-express
or
yarn add arctic-express
Quickstart
The code below is all the code you need to set up a Create Read Update Delete API.
import express from "express";
import { Database, Model, column, CrudRouter } from "arctic-express";
class Person extends Model {
@column(String, { required: true })
name: string;
@column(Number)
age: number;
}
const db = new Database("pg://[user]:[password]@[host]:[port]/[schema]");
const table = db.table(Person);
const app = express();
app.use("/people", new CrudRouter(table).expressRouter());
app.listen(3000, () => console.log("Server Started"));