Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@publicodes/rest-api
Advanced tools
@publicodes/api
This package allows you to create a REST API, which follows OpenAPI 3.0 specifications, from your Publicodes rules.
It consists of Koa middleware that adds routes to your router:
POST
/evaluate
Evaluate one or more expressions with a given situationGET
/rules
Returns the list of all your rulesGET
/rules/{rule}
Returns a specific rulenpm install @publicodes/api
import Router from '@koa/router'
import Koa from 'koa'
import Engine from 'publicodes'
import { koaMiddleware as publicodesAPI } from '@publicodes/api'
const app = new Koa()
const router = new Router()
// Create middleware with your Engine
const apiRoutes = publicodesAPI(new Engine('coucou: 0'))
// Basic routes usage (/evaluate, /rules, etc.)
router.use(apiRoutes)
// Or use with specific route prefix (/v1/evaluate, /v1/rules, etc.)
router.use('/v1', apiRoutes)
app.use(router.routes()).listen(3000)
// ...
A complete example file is in the sources if needed : example.ts.
1.0.0-rc.4
@publicodes/rest-api
FAQs
Publicodes API
The npm package @publicodes/rest-api receives a total of 9 weekly downloads. As such, @publicodes/rest-api popularity was classified as not popular.
We found that @publicodes/rest-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.