# @aylias/quickserve

> A module to quickly set up an express server

Latest version **1.0.1** (published 2021-12-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install @aylias/quickserve
pnpm add @aylias/quickserve
yarn add @aylias/quickserve
bun add @aylias/quickserve
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2021-12-07 |
| First published | 2021-12-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Aylias |
| Maintainers | aylias |

## Links

- npm: https://www.npmjs.com/package/@aylias/quickserve
- npm.io page: https://npm.io/package/@aylias/quickserve

## Dependencies (1)

- [express](https://npm.io/package/express.md) ^4.17.1

## Recent versions

- 1.0.1 (latest) — 2021-12-07
- 1.0.0 — 2021-12-07

## README

QuickServe wraps the express functions into a simpler to use format, allowing you to use less lines of code to achieve the same result.

```JavaScript
const qs = require('@aylias/quickserve')

const server = new qs(8055); // Create an instance of quickserve with the desired port

// Use get and post methods like normal
server.get('/', (req, res) => {
    res.writeHeader(200, { "Content-Type": "text/html" });
    res.write("<h1>You used a normal get method</h1>");
    res.end();
})

server.post('/', (req, res) => {
    res.writeHeader(200, { "Content-Type": "text/html" });
    res.write(`<h1>Your name is ${req.body.name}</h1>`);
    req.end();
})


// Automatically get and serve files of type html, css, json, and javascript
server.getHTML('/main', './main.html');
server.getCSS('/main.css', './main.css');
server.getJSON('/stats', './stats.json');
server.getJS('/main.js', './main.js');

server.serve();
```

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