@elsium-ai/app 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# @elsium-ai/app
|
|
2
|
+
|
|
3
|
+
App bootstrap, HTTP server, and API routes for [ElsiumAI](https://github.com/elsium-ai/elsium-ai).
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@elsium-ai/app)
|
|
6
|
+
[](https://github.com/elsium-ai/elsium-ai/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @elsium-ai/app @elsium-ai/core
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## What's Inside
|
|
15
|
+
|
|
16
|
+
- **HTTP Server** — Built-in server with route definitions
|
|
17
|
+
- **CORS** — Configurable cross-origin resource sharing
|
|
18
|
+
- **Auth** — Authentication middleware
|
|
19
|
+
- **Rate Limiting** — Request rate limiting per client
|
|
20
|
+
- **RBAC** — Role-based access control with inheritance and wildcard matching
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { createApp, createRBAC } from '@elsium-ai/app'
|
|
26
|
+
|
|
27
|
+
const rbac = createRBAC({
|
|
28
|
+
roles: [
|
|
29
|
+
{ name: 'viewer', permissions: ['model:read:*'] },
|
|
30
|
+
{ name: 'analyst', permissions: ['model:use:gpt-4o-mini'], inherits: ['viewer'] },
|
|
31
|
+
{ name: 'admin', permissions: ['*'], inherits: ['analyst'] },
|
|
32
|
+
],
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
const app = createApp({
|
|
36
|
+
port: 3000,
|
|
37
|
+
cors: { origins: ['http://localhost:5173'] },
|
|
38
|
+
rateLimit: { windowMs: 60_000, max: 100 },
|
|
39
|
+
})
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Part of ElsiumAI
|
|
43
|
+
|
|
44
|
+
This package is the app layer of the [ElsiumAI](https://github.com/elsium-ai/elsium-ai) framework. See the [full documentation](https://github.com/elsium-ai/elsium-ai) for guides and examples.
|
|
45
|
+
|
|
46
|
+
## License
|
|
47
|
+
|
|
48
|
+
[MIT](https://github.com/elsium-ai/elsium-ai/blob/main/LICENSE)
|