https://github.com/eik-lib/core
The implementation of the different HTTP API endpoint handlers
https://github.com/eik-lib/core
eik
Last synced: 27 days ago
JSON representation
The implementation of the different HTTP API endpoint handlers
- Host: GitHub
- URL: https://github.com/eik-lib/core
- Owner: eik-lib
- Created: 2019-10-14T23:56:16.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2026-06-05T14:30:35.000Z (about 1 month ago)
- Last Synced: 2026-06-05T16:17:31.786Z (about 1 month ago)
- Topics: eik
- Language: JavaScript
- Homepage: https://eik.dev
- Size: 1.62 MB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# @eik/core
This module holds the core server functionality of [`@eik/service`](https://github.com/eik-lib/service#readme).
Each [HTTP API endpoint](https://eik.dev/docs/server/http-api) has
its own class handling the specific path and method.
## API
### http
This namespace holds the different HTTP API endpoint handlers. Each handler is a class with an async `handler` method.
```js
import { http } from "@eik/core";
let pkgGetHandler = new eik.http.PkgGet({ organizations, sink, logger });
let response = await pkgGetHandler.handler(
request,
type,
name,
version,
extras,
);
```
For a more complete usage example, see
[the implementation in `@eik/service`](https://github.com/eik-lib/service/blob/00c85c1d366df50b688a82e62e5890381df11b0f/lib/main.js#L76-L113).
### prop
A gollection of globals holding base paths.
```js
import { prop } from "@eik/core";
const { base_auth, base_map, base_pkg, base_npm } = prop;
```
### HealthCheck
A health check implementation that does a create, read and delete check
against the configured [storage sink](https://eik.dev/docs/server/storage).
```js
import { HealthCheck } from "@eik/core";
const health = new HealthCheck({
logger,
sink,
});
await health.check();
```