Need a backend for your web? Start with Node.js

What is Node.js?

Why is used?

Where do we start?

Installing necessary tools

Let’s code

npm init
npm install -D typescript tslint @types/express
npm install -S express uuid
npm install
tsc --init
{
“compilerOptions”: { /* Visit https://aka.ms/tsconfig.json to read more about this file */
“target”: “ES2020”,
“module”: “commonjs”,
“outDir”: “dist”,
“strict”: true,
“skipLibCheck”: true,
"strictNullChecks": false,
“forceConsistentCasingInFileNames”: true
}
}
npm start
curl http://localhost:3000/ping

Testing

What are Mocha and Chai?

npm install chai mocha ts-node @types/chai @types/mocha chai-http @types/chai-http --save-dev

Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Marco Capo

Marco Capo

9 Followers

I’m a senior software engineer working in technology development for 12+ years from marketing, videogames and microservices for big companies