You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.1 KiB
TypeScript
51 lines
1.1 KiB
TypeScript
import _locreq from "locreq";
|
|
import { resolve } from "path";
|
|
import Sealious, { App, Collection, FieldTypes, Policies } from "sealious";
|
|
const locreq = _locreq(__dirname);
|
|
|
|
declare module "koa" {
|
|
interface BaseContext {
|
|
$context: Sealious.Context;
|
|
$app: Sealious.App;
|
|
$body: Record<string, unknown>;
|
|
}
|
|
}
|
|
|
|
const app = new (class extends App {
|
|
config = {
|
|
upload_path: locreq.resolve("uploaded_files"),
|
|
datastore_mongo: {
|
|
host: "localhost",
|
|
port: 20723,
|
|
db_name: "sealious-playground",
|
|
},
|
|
email: {
|
|
from_address: "sealious-playground@example.com",
|
|
from_name: "Sealious playground app",
|
|
},
|
|
};
|
|
manifest = {
|
|
name: "Sealious Playground",
|
|
logo: resolve(__dirname, "../assets/logo.png"),
|
|
version: "0.0.1",
|
|
default_language: "en",
|
|
base_url: "localhost:8080",
|
|
admin_email: "admin@example.com",
|
|
colors: {
|
|
primary: "#5294a1",
|
|
},
|
|
};
|
|
collections = {
|
|
...App.BaseCollections,
|
|
tasks: new (class extends Collection {
|
|
fields = {
|
|
title: new FieldTypes.Text(),
|
|
done: new FieldTypes.Boolean(),
|
|
};
|
|
defaultPolicy = new Policies.Public();
|
|
})(),
|
|
};
|
|
})();
|
|
|
|
app.start();
|