This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| axios.put(this.apiBaseEndpoint + '/' + id, input) | |
| .then((response) => { | |
| // Success | |
| }) | |
| .catch((error) => { | |
| // Error | |
| if (error.response) { | |
| // The request was made and the server responded with a status code | |
| // that falls out of the range of 2xx | |
| // console.log(error.response.data); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const axios = require('axios') | |
| ... | |
| const requestBody = { | |
| name: 'Akexorcist', | |
| age: '28', | |
| position: 'Android Developer', | |
| description: 'birthdate=25-12-1989&favourite=coding%20coding%20and%20coding&company=Nextzy%20Technologies&website=http://www.akexorcist.com/', | |
| awesome: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = class Product { | |
| constructor(id, title, imageUrl, description, price) { | |
| this.id = id; | |
| this.title = title; | |
| this.imageUrl = imageUrl; | |
| this.description = description; | |
| this.price = price; | |
| } | |
| save() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #add 'node_modules' to .gitignore file | |
| git rm -r --cached node_modules | |
| git commit -m 'Remove the now ignored directory node_modules' | |
| git push origin master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require('express'); | |
| const app = express(); | |
| app.use('/user', (req, res, next) => { | |
| console.log('in first Middleware'); | |
| res.send('<h1> Hello From second Page</h1>'); | |
| }); | |
| app.use('/', (req, res, next) => { | |
| console.log('in secon middleware'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const http = require('http'); | |
| const routes = require('./routes'); | |
| const server = http.createServer(routes); | |
| server.listen(3000); |