Security News
Research
Supply Chain Attack on Rspack npm Packages Injects Cryptojacking Malware
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
corbel-composer
Advanced tools
A corbel composer is a middleware based in nodeJS with express, to offer developers to make his own specific application API.
A corbel-composer is a middleware based in nodeJS with express, to offer developers to make his own specific application API bsed in corbel-js
[text]
[image]
install
npm install -g bq/corbel-composer
run server
corbel-composer
https://raw.githubusercontent.com/bq/corbel-composer/master/doc/postman.json
{
"url": "phraseName",
"get": {
"code": "res.render('index', {title: 'hello world'});",
"description": "Phrase description",
"query": {
"param1": {
"type": "Number",
"description": "Param description",
"default": 0
}
},
"responses": {
"200": {
"body": {
"application/json": {
"schema": {
"type": "object",
"description": "A canonical song",
"properties": {
"title": {
"type": "String"
},
"artist": {
"type": "String"
}
},
"required": [
"title",
"artist"
]
}
}
}
}
}
}
}
count
value in collections query{
"url": "countExample",
"get": {
"code": "CORBEL-JS_SNIPPET"
}
}
where code
should be a string with this corbel-js snippet:
var count;
corbelDriver.resources.collection('test:ComposrTest').get(undefined, {
aggregation: {
$count: '*'
}
}).then(function(response) {
count = response.data.count;
return corbelDriver.resources.collection('test:ComposrTest').get();
}).then(function(response) {
res.send({
data: response.data,
'count': count
});
}).catch(function(error) {
res.send(error);
});
{
"url": "paramsExample/:pathparam",
"get": {
"code": "res.status(200).send('path param: ' + req.params.pathparam + ', query param: ' + req.query.queryparam);"
}
}
Resource | GET (read) | POST (create) | PUT (update) | DELETE |
---|---|---|---|---|
/cars | Returns a list of cars | Create a new ticket | Bulk update of cars | Delete all cars |
/cars/711 | Returns a specific car | Method not allowed (405) | Updates a specific ticket | Deletes a specific ticket |
/purchase | Get al purchases | Create a new purchase | Bulk update of purschases | Delete all purchases |
/purchase/85 | Returns a purchase | Method not allowed (405) | Updates a specific purchase | Delete all purchases |
Resource GET read POST create PUT update DELETE /cars Returns a list of cars Create a new ticket Bulk update of cars Delete all cars /cars/711 Returns a specific car Method not allowed (405) Deletes a specific ticket
A simple way to achieve this is definning the phrase version in the url, like this
{
"url": "v1/paramsExample/:pathparam",
"get": { ... }
}
A phrase version should change only if the phrase contract is broken
clone repo
build image
docker build -t <username>/corbel-composer .
run container
docker run -d -p 3000:3000 --name="corbel-composer" <username>/corbel-composer
start/stop container
docker start/stop corbel-composer
npm test
grunt test:coverage
Requires node-inspector
npm install -g node-inspector
Server
npm run debug
Tests
npm run test:debug
FAQs
A corbel composer is a middleware based in nodeJS with express, to offer developers to make his own specific application API.
The npm package corbel-composer receives a total of 0 weekly downloads. As such, corbel-composer popularity was classified as not popular.
We found that corbel-composer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.
Security News
Sonar’s acquisition of Tidelift highlights a growing industry shift toward sustainable open source funding, addressing maintainer burnout and critical software dependencies.