Menu

How to send a html page on a page request on node?

While working with NodeJS server application, we may come to situation where we need to redirect out request to any html page and render the same html page to browser. Below is the sample code to send a html file as a response in NodeJS app. 

app.get('/home', (req, res) => {
    res.sendFile(publicPageDire+'/index.html')
})


In place of publicPageDire variable we could also use path.join() like below


app.get('/home', (req, res) => {
    res.sendFile(path.join(__dirname, '../public/index.html'))
})

How to exclude or skip some line of code from Sonar violations

Exclude and skip any line of code from Sonar, so sonar will not run the violation check on that line of code. This could be done by adding a comment "//NOSONAR" at the end of line of code or block of code.

For example, in this code Sonar is raising Critical vulnerability, but this needs to be present in the code and something which cannot be changed. So, in this situation, to run the sonar successfully, this line of code should get excluded from Sonar violation check, and to do so, there will be a comment //NOSONAR needs to get added at the end of this line of code. 

e.g.

AlgorithmParameterSpec paramSpec = new IvParameterSpec(IVAes); //NOSONAR


Reference

https://www.baeldung.com/sonar-exclude-violations

Theory of Transformation or Evolution(Parinamavada) | Indian Philosophy

The Samkhya view is found in the famous words of the Gita (2.16): “There can be no existence of the non-existent and no non-existence of the existent.”
According to this view, an effect is not a new entity; an effect is already contained in its cause in an unmanifested state, and the production of an effect merely means its manifestation. Since an effect exists in its cause in an unmanifested state even before its appearance, it is considered to be ever-existent (sat), and hence the Samkhya theory of causation is called Satkaryavada (the theory of ever-existent effect). As the manifestation of an effect is brought about by a change in the cause, which is conceived as a real change, it is called parinamavada or vikarvada, i.e., theory of transformation or evolution from the cause.