Totally surprised when I saw the search results for the key words: 'node and rest api in 5 minutes'
Building Rest API with LoopBack: Mind blowing, read this article: https://www.freecodecamp.org/news/build-restful-api-with-authentication-under-5-minutes-using-loopback-by-expressjs-no-programming-31231b8472ca/
About Loopback:
https://auth0.com/blog/developing-restful-apis-with-loopback/
https://www.npmjs.com/package/loopback
https://loopback.io/doc/en/lb4/express-with-lb4-rest-tutorial.html
Using Fastify:
https://medium.com/zero-equals-false/build-rest-apis-in-5-minutes-with-node-js-and-fastify-5c72b67e2cd3
Just nodeJS:
https://www.codementor.io/@olatundegaruba/nodejs-restful-apis-in-10-minutes-q0sgsfhbd
Wednesday, April 22, 2020
Saturday, April 18, 2020
ES6 Super quick reference
Arrow functions:
// ES5
function sayHello (name) {
return 'Hello ' + name
}
// ES6
const sayHello = (name) => 'Hello ' + name
console.log(sayHello('Ramesh'))
Variables:
var firstName = 'Ramesh'; // ES5 let firstName = 'Ramesh' // ES6 - have block scope const firstName = 'Ramesh' // ES6 - as it says, it's a constant
Template Strings:
let strWelcome = 'Welcome'
// use the backticks to combine strings with variableslet templateString = `${strWelcome} Ramesh` console.log(templateString)
async await:
https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Asynchronous/Async_awaitDestructuring:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignmentShorthand objects
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializerFunction arguments
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/argumentsExpand arrays
https://www.smashingmagazine.com/2016/07/how-to-use-arguments-and-parameters-in-ecmascript-6/let myArray = [1,2,3] Math.max(...myArray)
Classes
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/classnvm - switch node versions with nvm
Node Version Manager (nvm) helps to switch between different versions of nodejs. This article provides all the details on nvm:
Some basic commands:
https://michael-kuehnel.de/node.js/2015/09/08/using-vm-to-switch-node-versions.html
https://www.kulik.io/2019/05/01/set-default-node-version-using-nvm/
https://nodesource.com/blog/installing-node-js-tutorial-using-nvm-on-mac-os-x-and-ubuntu/
Some basic commands:
- To install nvm on mac: brew install nvm
- To install nodejs using nvm: nvm install node
- To install a specific version of nodejs: nvm install 13.5.0
- To use a specific version as default: nvm alias default 12.16.1
- To see what versions are available on your local: nvm list
- To use a specific version: nvm use <version number>
https://michael-kuehnel.de/node.js/2015/09/08/using-vm-to-switch-node-versions.html
https://www.kulik.io/2019/05/01/set-default-node-version-using-nvm/
https://nodesource.com/blog/installing-node-js-tutorial-using-nvm-on-mac-os-x-and-ubuntu/
npx - Installation-less command execution
You don't want to install some command but you want to use it on the fly! Well, npx comes to your rescue: https://nodejs.dev/the-npx-nodejs-package-runner
For a quick understanding of differences between npm and npx, read this: https://stackoverflow.com/questions/50605219/difference-between-npx-and-npm
Also read the interesting facts about Node.js: https://nodejs.dev/a-brief-history-of-nodejs
Also read the interesting facts about Node.js: https://nodejs.dev/a-brief-history-of-nodejs
Read thru this article that would help better understand an executable global module: https://medium.com/jspoint/creating-cli-executable-global-npm-module-5ef734febe32
Thursday, April 16, 2020
About JavaScript modules, module formats, module loaders, module builders
This article was written in 2017 and I was NOT blessed to read this till now. Well, better late than nothing. You want to know the intricacies of JavaScript modules, this is it, you have to read this.
Here is the link to the article: https://www.jvandemo.com/a-10-minute-primer-to-javascript-modules-module-formats-module-loaders-and-module-bundlers/
And then follow this article: https://www.sitepoint.com/understanding-module-exports-exports-node-js/, that explains the additional details of how to use nodeJS modules.
Here is the link to the article: https://www.jvandemo.com/a-10-minute-primer-to-javascript-modules-module-formats-module-loaders-and-module-bundlers/
And then follow this article: https://www.sitepoint.com/understanding-module-exports-exports-node-js/, that explains the additional details of how to use nodeJS modules.
Subscribe to:
Posts (Atom)