Skip to content

Instantly share code, notes, and snippets.

@ManotLuijiu
Created April 14, 2020 11:34
Show Gist options
  • Save ManotLuijiu/b1b9ac179ddfa1bdc46532c6b61c8dda to your computer and use it in GitHub Desktop.
Save ManotLuijiu/b1b9ac179ddfa1bdc46532c6b61c8dda to your computer and use it in GitHub Desktop.
Config express for backend
const express = require('express');
const app = express();
// HTTP Methods CRUD => Create,Read, Update and Delete
app.get('/', (req, res) => {
res.send('Hi, There Manot Luijiu');
}); // Read
// app.post(params); // Create
// app.put(params); // Update
// app.delete(params); // Delete
const PORT = process.env.PORT || 5000;
app.listen(PORT, () => {
console.log(`Server is running on PORT ${PORT}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment