This file contains 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
var Minio = require('minio') | |
// Instantiate the minio client with the endpoint | |
// and access keys as shown below. | |
var minioClient = new Minio.Client({ | |
endPoint: 'localhost', | |
port: 9000, | |
useSSL: false, | |
accessKey: '0OPKIKKR058HTBYXV2JA', | |
secretKey: 'oT7jT9a0u5UTWoNW5nU+wMdE3lfRtwL5B0FZVRVu' |
This file contains 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
import React,{Component} from 'react' | |
import logo from './logo.svg'; | |
import Contact from './Contacts' | |
class App extends React.Component { | |
//Pass the callback in the props | |
constructor(props){ | |
super(props) | |
this.state = { | |
contacts : [ |
This file contains 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
import React,{Component} from 'react' | |
import logo from './logo.svg'; | |
import Contact from './Contacts' | |
class App extends React.Component { | |
//Pass the callback in the props | |
constructor(props){ | |
super(props) | |
this.state = { | |
contacts : [ |
This file contains 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
Following four HTTP methods are commonly used in REST. | |
• GET - This is to provide a read-only access to resource. | |
• PUT - This is to create a new resource | |
• DELETE - This is to remove a resource | |
• POST - This is to update a existing resource or create a new resource. | |
When we try to use PUT and DELETE in HTML, we have a problem. Browsers do support PUT and DELETE but it only by using request via AJAX, but not via 'HTML form' submission. | |
https://dev.to/moz5691/method-override-for-put-and-delete-in-html-3fp2 |
This file contains 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
async function timerTask(){ | |
let [data1, data2] = await Promise.all([ | |
new Promise(function(resolve , reject){ | |
setTimeout(()=>{ | |
resolve('data1!') | |
}, 1000) |
This file contains 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
let date = new Date() | |
date.toLocaleString('default', { month: 'short' }) //narrow , long short available |
This file contains 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
200- OK; Standard response for successful HTTP requests | |
201- Created; Request has been fulfilled. New resource created | |
204- No Content; Request processed. No content returned | |
301- Moved Permanently; This and all future requests directed to the given URI | |
304- Not Modified; Resource has not been modified since last requested | |
400- Bad Request; Request cannot be fulfilled due to bad syntax | |
401- Unauthorized; Authentication is possible, but has failed | |
403- Forbidden; Server refuses to respond to request | |
404- Not Found; Requested resource could not be found | |
500- Internal Server Error; Generic error message when server fails |
This file contains 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
var evens = [2,4,6,8,10]; | |
var odds = evens.map(v=>v+1) | |
var pairs = evens.map(value => ({even : value , odd :value+1})) | |
console.log('odds', pairs) | |
//This works differntly in arrow function | |
var object = { |
This file contains 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 myObject = { | |
"a":"a", | |
"b":{ | |
"c":"c", | |
"d":{ | |
"e":"e", | |
"f":{ | |
"g":"g", | |
"h":{ | |
"i":"i" |
This file contains 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
Common Node.js deployment problems | |
Problems occurring in Node.js application deployments can have a range of symptoms, but can generally be categorized into the following: | |
Uncaught exception or error event in JavaScript code | |
Excessive memory usage, which may result in an out-of-memory error | |
Unresponsive application, possibly looping or hanging | |
Poor performance | |
Crash or abort in native code | |
Unexpected application behavior or functional issue |
NewerOlder