# @serverful/core

> The core Serverful library

Latest version **0.0.1** (published 2021-02-22) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @serverful/core
pnpm add @serverful/core
yarn add @serverful/core
bun add @serverful/core
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2021-02-22 |
| First published | 2021-02-22 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 14.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | QSmally |
| Maintainers | smally |

## Links

- npm: https://www.npmjs.com/package/@serverful/core
- Repository: https://github.com/ServerfulArch/Core
- Homepage: https://github.com/ServerfulArch/Core#readme
- Issues: https://github.com/ServerfulArch/Core/issues
- npm.io page: https://npm.io/package/@serverful/core

## Dependencies (2)

- [ejs](https://npm.io/package/ejs.md) ^3.1.6
- [qulity](https://npm.io/package/qulity.md) ^2.1.0

## Recent versions

- 0.0.1 (latest) — 2021-02-22
- 0.0.3 (alpha) — 2021-05-10
- 0.0.2 — 2021-03-03

## README

# Serverful
## The core Serverful library

[[Contribute](#issues-contributing--license)] [[Documentation](https://github.com/ServerfulArch/Core/blob/master/Documentation/Index.md)]

> An interface for creating HTTP servers, together with powerful features and extensions.


# Main Features
* Effective and performant HTTP interface.
* Shortcut behaviour, like gateways and redirects.
* Optional integration of EJS templates.
* Native cookie parsing.

## Links
* [Documentations](https://github.com/ServerfulArch/Core/blob/master/Documentation/Index.md)
* [Github](https://github.com/Serverful/Core)

## Extensions
* [Public file server](https://github.com/ServerfulArch/Public)

## Install/Import
`npm install @serverful/core`
```js
const Serverful = require("@serverful/core");
// ...
```


# Usage
Creation of a Serverful instance.
```js
const MyServer = new Serverful(Port);
```

## Gateways
```js
// /**
MyServer.Incoming(Handler);

// /public/**
MyServer.Gateway("public", Handler);

// /api/**
MyServer.Gateway("api", Handler);
```

## Requests
```js
// Redirect the user relatively or absolute.
Packet.Request.Redirect("/dashboard/");
Packet.Request.Redirect("https://duckduckgo.com/");

// Render an EJS template.
Packet.Request.Render(EJSTemplate, Document)
.then(() => Packet.Request.End(200))
.catch(() => Packet.Request.End(500));

// JSON.
Packet.Request.JSON(Document);
```


# Issues, Contributing & License
Before making an issue for a bug or feature submittion, please ensure that it hasn't already been created [on the repository](https://github.com/ServerfulArch/Core/issues).

This module is licensed under [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0).

---
_Source: https://npm.io/package/@serverful/core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
