Skip to content

Instantly share code, notes, and snippets.

@smashdevcode
Created December 11, 2023 01:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smashdevcode/c9e78c5e0173535c985226bed749e849 to your computer and use it in GitHub Desktop.
Save smashdevcode/c9e78c5e0173535c985226bed749e849 to your computer and use it in GitHub Desktop.
Express Starter App
const express = require('express');
// Call the `express` function to create the Express application.
const app = express();
// Define a GET route for the path `/`.
app.get('/', (req, res) => {
// Return a JSON formatted response.
res.json({ message: 'Hello world!' });
});
const port = 8081;
// Start the app listening on the provided port.
// The callback function will be called once the server has been started.
app.listen(port, () => console.log(`Listening at http://localhost:${port}...`));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment