Skip to content

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

License

Notifications You must be signed in to change notification settings

wibbuffey/slope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Links

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

If you want to contribute:

About

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

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published