harperdb
Version:
HarperDB is a distributed database, caching service, streaming broker, and application development platform focused on performance and ease of use.
22 lines (21 loc) • 583 B
JavaScript
/** Here we can define any JavaScript-based resources and extensions to tables
export class MyCustomResource extends tables.TableName {
// we can define our own custom POST handler
post(content) {
// do something with the incoming content;
return super.post(content);
}
// or custom GET handler
get() {
// we can modify this resource before returning
return super.get();
}
}
*/
// we can also define a custom resource without a specific table
export class Greeting extends Resource {
// a "Hello, world!" handler
get() {
return { greeting: 'Hello, world!' };
}
}