Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// Endpoint 1
app.get('/api', function(req, res){
res.send('Welcome to our API')
// Endpoint 2
app.get('/api/users', function(req, res){
// Endpoint 3
app.get('/api/user/:id', function(req, res){
const id =;
const user = userData.find(user => === id);
if (user) {
else {
res.send('No User Found')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.