/images/profile.png

Enable Spotlight search on Mac

Method 1 Navigate to System Preferences Spotlights Privacy Add your local disk to the list Remove your local disk from the list The above steps will reindex spotlight on the selected disk Method 2 In terminal run: 1 2 sudo mdutil -E / sudo mdutil -a -i on Above commands fixed everything for me

Add Google Analytics to Hugo Blog

Google Analytics Register a google analytics account Get your measurement ID that looks like below G-6ED0IWOAJK Get gtag js script 1 2 3 4 5 6 7 8 <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-6ED0IWOAJK"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-6ED0KEHXFZ'); </script> Hugo blog Find config.

What is API

What is API Application Programming Interface: allows two applications to talk to each other What is REST API REST (Representational State Transfer): A set of functions for developers to perform requests and receive responses using HTTP protocol Challenges under API testing API Documentation (need endpoint, parameters, resources, data) Access to DB (Validate response by comparing response to DB) Authorization overhead (Handle tokens) Core components of HTTP request HTTP request methods URI Resources and parameters Request header (JSON, XML) Request body (message content) What is Payload Payload/body is secured input data sent to API In JSON What is JSON JavaScript Object Notation Data format represented as String-text Authentication Techniques used in API’s Session/Cookie based Authentication Basic Authentication Digest Authentication OAuth Why API testing is suitable for automation testing API testing is:

Rest API with Express.JS

To include packages/files Include packages: packages are from package.json const express = require('express'); const router = express.Router(); router.get('/', (req, res) => res.send('Profile route')); const jwt = require('jsonwebtoken'); Inlucde route/file: 1 2 3 4 // db.js module.exports = connectDB; // In server.js const connectDB = require('./config/db') connectDB(); File return 1 2 module.exports = connectDB; module.exports = router; Try catch 1 2 3 4 5 6 7 8 9 10 11 12 13 const connectDB = async () => { try{ await mongoose.

HTTP

HTTP methods GET: Retrieve data from a server only HTTP GET won’t have payload or request body, just send URL only, it simply retrieves data POST: Add data (create a new object) on the server PUT: Update an existing object or resource in a server DELETE: Delete data from a server Remove is NOT an HTTP verb HTTP status code cheatsheet 1xx status codes: Informational requests 2xx status codes: Successful requests 3xx status codes: Redirects 4xx status codes: Client errors 5xx status codes: Server errors 1 2 3 4 5 6 7 8 9 10 11 CodeStatusDescription200OKTherequestissuccessful201CreatedAnewresourcewassuccessfulycreated301Misingparameter400BadrequestTherequestisinvalid(Myproblem)401UnauthorizedRequiresauthentication403ForbiddenTheclientisauthenticatedbutdoesn'thavepermissiontoaccesstherequestedresource404NotFoundTherequestedresourcewasnotfound(API'sproblem)405MethodnotallowedHTTPrequestmethodisnotsupported(useGETtoupdate)500InternalServererror503Serverunavailable Ref: https://stackoverflow.

What is SOA

What is SOA Service Oriented Architecture: Distributed system architecture where all components are designed to be services eg. Cloud solutions are based on SOA Key attributes Services over components Interoperability & Cross platform Loose coupling & Distributed Abstraction against complexity SOA Components Services: Pieces of software that are autonomous, self-contained and accessible Automic services: well-defined and independent Composite: fusion of two or more automic services Types: frontend, integration, business, public enterprise, infrastructure ESB: Enterprise bus (backbone of a SOA system)