Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

express api make

const express = require('express')
const app = express()
const port = 3000

app.use(express.json());
app.use(express.urlencoded({ extended: true }));

app.get('/users/name', (req, res) => {// users/name?name=Alex
  return res.send(
    `How are you ${req.query.name} !`,
  ); // How are you Alex
}); 

app.get('/users/:userId', (req, res) => {// users/Alex
  return res.send(
    `How are you ${req.params.name} !`,
  );// How are you Alex
});

app.listen(port, () => {
  console.log(`Example app listening at http://localhost:${port}`)
})
Comment

express api

app.render('email', function (err, html) {
  // ...
})

app.render('email', { name: 'Tobi' }, function (err, html) {
  // ...
})
Comment

PREVIOUS NEXT
Code Example
Javascript :: js check if date is future 
Javascript :: return index of array with function in array angular 
Javascript :: select element by data 
Javascript :: javascript sleep function 
Javascript :: javascript fill array 
Javascript :: atob nodejs 
Javascript :: How to add and play sounds in JS 
Javascript :: how to get values from select multiple in js 
Javascript :: get the difference between two dates js 
Javascript :: moment js year only 
Javascript :: jquery disable keypress 
Javascript :: js Convert the characters to the html 
Javascript :: class with attribute selector jquery 
Javascript :: javascript camera 
Javascript :: `object` ("[object Object]") cannot be serialized as JSON. Please only return JSON serializable data types 
Javascript :: discount calculator javascript 
Javascript :: create angular app with routing and scss 
Javascript :: get only one value from object array javascript 
Javascript :: sleep js 
Javascript :: padend method javascript 
Javascript :: call function in javascript from html 
Javascript :: jest console.log 
Javascript :: create textbox using javascript 
Javascript :: how to use more than one transform in javascript 
Javascript :: generate component with module angular 8 
Javascript :: react native different styles for ios and android 
Javascript :: reverse a linked list javascript 
Javascript :: react event stop propagation 
Javascript :: js is date 
Javascript :: how to reverse a string in javascript 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =