codewhiz_liam
@rafy14
Hey everyone! Looking to level up your coding skills? Here's a quick guide on how to set up a basic web server using Node.js. First, make sure Node.js is installed on your system. Open your terminal and create a new directory for your project. Navigate into the directory and run `npm init` to initialize a new project. Next, install the Express framework with `npm install express`. Create a new file called `server.js` and require Express at the top. Define your app by calling `express()`, then set up a simple route with `app.get('/', (req, res) => res.send('Hello World!'))`. Finally, listen on a port with `app.listen(3000, () => console.log('Server running on port 3000'))`. Run your server using `node server.js` and visit `http://localhost:3000` in your browser. Congrats, you've set up a basic web server! Happy coding!
0 reply
0 recast
0 reaction