Aha, so I have contributed to JS bloat and NPM development hell by creating a new framework called Hextec.
The Github repository can be found here:
https://github.com/rohand2290/hextec
One of the things I had wanted it to do was to have no Express.js code whatsoever (which ultimately made a lot of things harder regardless. It works by defining handler functions for different routes.
Code:
This code defines a rootHandler that returns a Date object. Mainly it is used for building REST API's.
You can create an app by using the Hextec bootstrapper. You can install it by using
npm install -g hextec. Then run hextec new <name_of_app> and it will create a directory with the name you specified. Change into that directory and then run npm start, and it should start a web server at port 8080 (but you can configure it in anyway you want)
The Github repository can be found here:
https://github.com/rohand2290/hextec
One of the things I had wanted it to do was to have no Express.js code whatsoever (which ultimately made a lot of things harder regardless. It works by defining handler functions for different routes.
Code:
const HextecCreator = require("hextec").HextecCreator;
const Route = require("hextec").Route;
const RestResponse = require("hextec").Route;
const rootHandler = () => {
return new RestResponse(JSON.stringify({ date: new Date() }));
};
const app = HextecCreator.createApp([new Route("/", rootHandler)]);
app.run(8080);
This code defines a rootHandler that returns a Date object. Mainly it is used for building REST API's.
You can create an app by using the Hextec bootstrapper. You can install it by using
npm install -g hextec. Then run hextec new <name_of_app> and it will create a directory with the name you specified. Change into that directory and then run npm start, and it should start a web server at port 8080 (but you can configure it in anyway you want)