
Security News
Potemkin Understanding in LLMs: New Study Reveals Flaws in AI Benchmarks
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
@phish108/web-service-core
Advanced tools
Synthesize common functions for JS-Koa Webserivces.
This package serves as the foundation for the sdg js services. It allows to focus on handler functions instead by removing common code. It also enforces common standard practices for the services.
winston
)npm install @phish108/web-service-core
After that the component can be included in the project.
import * as App from "@phish108/web-service-core"
// load your service's request handlers
import * as ServiceHandler from "./handler"
// load your service's configuration defaults, which should
// include your endpoint definition.
import defaults from "./defaults.json" with {type: "json"};
const instance = await App.init(defaults, ServiceHandler);
// run any module level initialisation based on instance.config etc.
instance.run();
The instance has a single run()
function, but includes references to
the service's config
, Logger
, message queue (mq
) and graphql
database (db
). These options can be used to initialise anly components
if needed. These components are also available per request in the
request's ctx.state
object.
This system uses @phish108/yaml-configurator
for system configuration.
This allows for flexible service configuation in YAML or JSON with default
presets.
The defaults
need to be provided as JSON (to make us of the JSON importer).
In order to make this module work for you, you need to define your endpoint logic under endpoints. The following example shows a simple service configuation with a single endpoint.
{
"endpoints": [
{
"route": "/hello",
"method": "post",
"handler": [
"loadFromDatabase",
"respondHello"
]
}
]
}
The handler list needs to be a list of type string, where each string
is a handler provided in your ServiceHandler
-object. Internally these
handlers are stacked by docker compose in the given sequence. If a handler
is missing, the service raises an error and refuses to start.
The init()
function requires the defaults and the service handler object.
Optionally, one can pass a number of locations where the module should look
for the configuration files. By default the module will check the following
locations in the order given below:
/etc/app/config.yaml
/etc/app/config.json
./config.yaml
./tools/config.yaml
It is convinient not to touch these locations and just place your config
in one of these locations in your Docker container. If you insist, you
can pass custom locations to the init()
function. These locations
will be prepended to the default locations, so in case a sysadmin ignores
your locations the default locations will still work.
FAQs
Basic Wrapper for Service Endpoints for REST and MQ
The npm package @phish108/web-service-core receives a total of 5 weekly downloads. As such, @phish108/web-service-core popularity was classified as not popular.
We found that @phish108/web-service-core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.