slope

slope.js is a web server library written in Node.js that strives to be as feature-filled as it is easy-to-use.

View the Project on GitHub wibbuffey/slope

slope.js

The webserver framework you never knew you needed!

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

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

If you want to contribute:

To begin reading the documentation: