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:

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)
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement