schemejs
Scheme.js is a project designed to make building servers modular and fast.
Install
npm i schemejs
Example Server
This is the server I use on all my projects.
const express = ;const app = ;const http = ;const scheme = ;const fs = ;const cors = ;var bodyParser = ;app; // to support JSON-encoded bodiesapp;app;var s = apijs;const megaquery = ;app;app;http;
You can see Scheme.js working on line 14, this is where the server reads the "api.js" file. Then on 15 it loads the file into scheme. The way Scheme.js works is through the "api.js" file.
Api.js
This is an example of the api.js file.
var apijs =loud:client:name: "lakefox"server:{return JSON;}...
Request
This is an example request made by the client.
// Send the request to the server;
Post Function
This is the post function I use to talk to the server, it simplifies things down a lot.
{// Replace this with your servers urlvar url = 'http://localhost:8080/api';var data = store: {};datastorename = value;return {;};}