1.0.1 • Published 2 years ago

fuckingeasyframework v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

EasyFramework

A simple extremely light weight framework if you want to get fucking shit done the easy way. Long gone are the days of stupid fucking documentation and boilerplate. Just get shit done the quick and fast way, without trouble.

Install

npm install fuckingeasyframework

Documentation

Please go https://github.com/Sopur/EasyFramework/tree/main/example for examples on each way to create servers, which basically include all functions.

HTTP server example

const EF = require("fuckingeasyframework");

const httpPort = 3000;

const $ = new EF.new({
    http: new EF.HTTP_OBJ(httpPort),
});
const app = $.app;
const backend = $.backend;

$.on("http_start", () => console.log(`HTTP server listening on port ${httpPort}.`));

app.use(backend.static(__dirname + "/serve"));
app.get("/", (req, res) => {
    res.sendFile(__dirname + "/serve/main.html");
});

$.start();

HTTPS example

const fs = require("fs");
const EF = require("fuckingeasyframework");

const httpsPort = 8080;
const privateKey = fs.readFileSync(__dirname + "/keys/privatekey.pem", "utf-8");
const publicKey = fs.readFileSync(__dirname + "/keys/publickey.pem", "utf-8");

const $ = new EF.new({
    https: new EF.HTTPS_OBJ(httpsPort, privateKey, publicKey),
});
const app = $.app;
const backend = $.backend;

$.on("https_start", () => console.log(`HTTPS server listening on port ${httpsPort}.`));

app.use(backend.static(__dirname + "/serve"));
app.get("/", (req, res) => {
    res.sendFile(__dirname + "/serve/main.html");
});

$.start();

Both example

const fs = require("fs");
const EF = require("fuckingeasyframework");

const httpPort = 3000;
const httpsPort = 8080;
const privateKey = fs.readFileSync(__dirname + "/keys/privatekey.pem", "utf-8");
const publicKey = fs.readFileSync(__dirname + "/keys/publickey.pem", "utf-8");

const $ = new EF.new({
    http: new EF.HTTP_OBJ(httpPort),
    https: new EF.HTTPS_OBJ(httpsPort, privateKey, publicKey),
});
const app = $.app;
const backend = $.backend;

$.on("http_start", () => console.log(`HTTP server listening on port ${httpPort}.`));
$.on("https_start", () => console.log(`HTTPS server listening on port ${httpsPort}.`));

app.use(backend.static(__dirname + "/serve"));
app.get("/", (req, res) => {
    res.sendFile(__dirname + "/serve/main.html");
});

$.start();

Description