3.0.13 • Published 2 months ago
@andrewcaires/api v3.0.13
API
Simple api for small applications using express, jsonwebtoken, sequelize and websocket
Installation
The module is now available on npm! npm i @andrewcaires/api
Example usage
// .env
NODE_ENV=development
API_DB_TYPE=mariadb
API_DB_DATABASE=database
API_DB_HOST=localhost
API_DB_USERNAME=root
API_DB_PASSWORD=
API_DB_LOG=false
API_DB_PORT=3306
API_HTTP_PORT=3000
API_HTTP_PUBLIC=/public
API_HTTP_CROSS=true
API_HTTP_CRT=http.crt
API_HTTP_KEY=http.key
API_TOKEN_CRT=token.crt
API_TOKEN_KEY=token.key
API_TOKEN_LIFETIME=3000
API_WEBSOCKET_START=false
// index.ts
import {
App,
AuthController,
GroupController,
GroupRouteController,
LogsController,
RouteController,
UserController,
UserGroupController,
} from "@andrewcaires/api";
const main = async () => {
const app = new App(
[
new AuthController("/auth"),
new GroupController("/groups"),
new GroupRouteController("/groups"),
new LogsController("/logs"),
new RouteController("/routes"),
new UserController("/users"),
new UserGroupController("/users"),
]
);
await app.listen();
};
main().catch(console.log);
Links
License
3.0.13
2 months ago
3.0.12
4 months ago
3.0.11
6 months ago
3.0.10
12 months ago
3.0.9
1 year ago
3.0.8
1 year ago
2.0.3
1 year ago
3.0.4
1 year ago
3.0.3
1 year ago
3.0.2
1 year ago
3.0.1
1 year ago
3.0.7
1 year ago
3.0.6
1 year ago
3.0.5
1 year ago
3.0.0
1 year ago
2.0.2
2 years ago
2.0.1
2 years ago
2.0.0
2 years ago
1.0.9
2 years ago
1.0.11
2 years ago
1.0.10
2 years ago
1.0.8
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.0
2 years ago