Skip to content

Commit

Permalink
Merge branch 'moleculerjs:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
maxinminax authored Nov 24, 2023
2 parents b2582f1 + a20e5de commit b501e78
Show file tree
Hide file tree
Showing 7 changed files with 4,499 additions and 4,018 deletions.
27 changes: 23 additions & 4 deletions examples/simple/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,27 @@ broker.createService({
mixins: [
DbService({
adapter: {
/*type: "Knex",
type: "Knex",
options: {
knex: {
client: "sqlite3",
connection: {
filename: ":memory:"
}
}
}*/
type: "MongoDB"
}
//type: "MongoDB"
},

createActions: {
remove: false
}
})
],

settings: {
fields: {
id: { type: "string", primaryKey: true, columnName: "_id", generated: "user" },
id: { type: "string", primaryKey: true, columnName: "_id" /*, generated: "user"*/ },
title: {
type: "string",
max: 255,
Expand All @@ -92,6 +96,21 @@ broker.createService({
}
},

actions: {
remove: {
rest: {
method: "DELETE",
path: "/:id"
},
params: {
id: { type: "string" }
},
async handler(ctx) {
console.log("Do something");
}
}
},

async started() {
const adapter = await this.getAdapter();
if (adapter.createTable) await adapter.createTable();
Expand Down
Loading

0 comments on commit b501e78

Please sign in to comment.