1.2.0 • Published 3 years ago

slope.js v1.2.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Introduction

slope is an object-oriented zero-dependency class-driven webserver library written in Node.js. It allows the user high-level access to numerous functions that allow the user to render HTML documents, send files, return JSON data, and much more.

In short, it allows you to create a webserver like this:

const Slope = require("slope.js");
const server = new Slope.Server();

server.routes.add("/", (client, result) => {
  result.send("Hello, world!");
});

server.run();

Try it -- this is completely working Slope code! If you want to dynamically load routes, you can do something like what was described in discussion #8:

const Slope = require("slope.js");
const server = new Slope.Server();

server.routes.add("*", (client, result) => {
  try {
    require(`./routes/${client.url}`)(client, result);
  } catch (error) {
    Slope.raiseErrors(404);
  }
});

server.run();

Install

Install and update using npm:

npm i slope.js

Alternatively, for the latest and most unstable version, clone with GitHub:

gh repo clone wibbuffey/slope # download slope
cd slope                      # enter the directory

Links

If you want to follow the project or ask for help:

If you want to contribute:

1.2.0

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago