3 ms·
Well "place an index.php file in a folder to deploy" is a lot of server (maybe Apache / PHP) running to support that. Node typically IS the server. So, you cou
by itslennysfault 4y ago
Well "place an index.php file in a folder to deploy" is a lot of server (maybe Apache / PHP) running to support that.
Node typically IS the server. So, you could install express and have a simple web server listening on a port and serving up html or json in about 5 lines of code. Unlike PHP Node is not, in itself, a templating language. So if you want to render HTML pages you'd also need to install something like EJS, but generally node servers are just serving up JSON API, and your frontend would be some frontend framework (React, angular, vue). Although all of that is trending back the other way with NextJS the old is new again and server-side rendering is the hotness again.
Another option is to use a framework like NestJS. With that you do
# install the nest cli (only needed for starting a new project)
npm i -g @nestjs/cli
# scaffolds a new project
nest new project-name
cd project-name
# node server is now running on port 3000
npm start
For easy deploy. That was kinda Heroku's thing. You just "git push" a node project and it magically knows how to deploy it, but Heroku got bought by Sales Force and murdered from my understanding. There are a lot of alternatives though. AWS, Azure, Google, CloudFlare, Digital Ocean, etc, etc all have similar offerings where you just push a node project to git and it deploys automagically.
Alternatively you can use AWS Lambda / Azure functions (or a dozen other "serverless" solutions) and you can just drop js files (functions) and they run on demand.
For a ProcessWire alternative there are a ton of options. A few I've seen are: Ghost, ButterCMS, Strapi
- themodelplumber 4y agoThanks for the info! > AWS, Azure, Google, CloudFlare, Digital Ocean, etc I'm always curious to know if there are more casual options in this space, for non-earthshaking projects. Maybe more like how DO was at the beginning?
- belmont_sup 4y agoHandful of great new hosts I’ve seen pop up: Render.com, Fly.io, northflank. And I actually like AWS lambdas, so great option for me is SST.dev, which wraps AWS CDK, and provides an actual live development workflow with actual AWS resources.
- steve_adams_86 4y agoI’ve been using fly.io for little things and it’s remarkably nice and easy to use. I can’t vouch for large scale projects, but for little things you want to experiment with it’s a joy.