-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Placeholder for now... some areas to flesh out in this issue:
- new dsl examples, whats new whats the same (eg. properties, relations)
- templates, what are they, how do they work
- basic tooling examples
Here is a basic example to get something on paper... I'd assume everything about it will change. The purpose is to start a conversation:
DSL example
resources:
- Account:
controller:
routes:
- 'GET /summary/{accountNumber} => getSummary(accountNumber : string) => AccountSummary'
dataSource: accountService
- Customer:
api: false
dataSource: customerService
- Transaction:
api: false
dataSource: transactionService
dataSources:
- accountService:
connector: swagger
url: 'http://.../swagger.json'
- customerService:
connector: swagger
url: 'http://.../swagger.json'
- transactionService:
connector: swagger
url: 'http://.../swagger.json'Template example
// resource template
function resourceTmpl(resource) {
ensureFile(modelClassFilename(resource.name), MODEL_CLASS_TMPL, resource);
ensureFile(controllerFilename(resources.name), CONTROLLER_CLASS_TMPL, resource);
ensureFile(repositoryFilename(resource.name), REPO_CLASS_TMPL, resource);
if (resource.dataSource !== false) {
ensureFile(datasourceFilename(resource.name), DS_TMPL, resource);
}
}Metadata
Metadata
Assignees
Labels
No labels