We have upgraded the community system as part of the upgrade a password reset is required for all users before login in.

NodeJS express http server



  • I plan to migrate my existing Omega project in Python to NodeJS.

    I've installed node package, but there's too little space to install npm. I'd like to keep the project small, without external storage space attached to Omega.

    The project requires serving http requests. I'd like to use Express, but I am not sure how to get it working without npm. Has anyone succeeded in it? Or, perhaps, I should choose another http server for this platform?



  • Ok, I can report some success:

    On my Linux Ubuntu, I've created an empty dir, created package.json file with contents:

    {
     "name": "Express4Omega",
     "version": "1.0.0",
     "description": "Testing the Node.js+express on Omega platform",
     "main": "index.js",
     "dependencies": {
       "express": "4.2.x"
     }
    }
    

    Then ran $ npm install --no-bin-links, to let the npm get the packages and put them in the local node_modules dir.
    After the npm was done installing, I created an index.js file with the hello world example.

    Then copied the folder to Omega, and ran # node index.js, and the hello world example is served from Omega just fine.

    However, with node and express installed, the flash memory of Omega is pretty much full: 14.292 MB / 15.232 MB. My little project will squeeze in the remaining 1MB without any problems, but there's very little room for any extra packages should your project require any.



  • Well, damn, I ran out of space šŸ™‚

    I needed to install serialport library, but since it is platform-specific, it has to be built on the Omega, and don't know how it is possible to do it without npm. And, if I install npm, then the free space on flash memory is basically exhausted.

    Wanted to stay purist and live without that extra flashdrive storage, but it seems that for any moderately elaborate project there's no way to squeeze everything in those 15MB. Heading to store to get that ultra-small low-profile drive now.



  • Busy box normaly comes with a httpd server too. Just for the Onion/OpenWRT they took a slimmer version. Check out if you can substitute your version of busybox and if you can run the rest of it together.


Log in to reply
 

Looks like your connection to Community was lost, please wait while we try to reconnect.