node.js – a nightmare to get started. Did I try the wrong technology for my problem?
Posted by jpluimers on 2017/03/08
Most of my web-stuff is on Apache. Which works fine, has TLS/SSL enabled, etc.
First of all, virtually all examples explain how to run node as a script. But none explain where to save it, how to run it as a service (and restart when it crashes: it will crash) or how to run multiple sites under it. And the scripts seems to listen to a TCP port by themselves so they operate as a full server by themselves. Nice for a fully fledged portal, but not for some one-offs.
Some links below hopefully will get me re-started later on, but for now, I’ve given up: the out-of-the-box experience is totally non-intuitive.
If you know a better way to do what I want (serving small mostly single-page scripts written in an easy to debug/trace language) let me know.
So basically work around this:
XMLHttpRequest cannot load http://myApiUrl/login. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
Anyway: the links:
- How to deploy your node app on Linux, 2016 edition
- Yes, you need to *manually* create your own systemd servies. Aaaargh!
- service – How do I run a Node.js application as its own process? – Stack Overflow
- Installing Node.js via package manager | Node.js
- Usage | Node.js v6.4.0 Documentation
- About | Node.js (totally useless: it gives no clue on how to get started).
- sindresorhus/awesome-npm: Awesome npm resources and tips
- blog.izs.me — Unix Philosophy and Node.js talks about “Small is beautiful”, but node.js feels monolithic to me.
- sindresorhus/awesome-nodejs: Delightful Node.js packages and resources
- Express application generator
- node.js – Which method of caching is the fastest/lightest for Node/Mongo/NginX? – Stack Overflow
- RUN APACHE WITH NODE JS REVERSE PROXY – USING REDBIRD – one zerology
- How to run Apache and Node.js together (the right way)
- linux – Best practices when running Node.js with port 80 (Ubuntu / Linode) – Stack Overflow