Setup a Simple NodeJS Server with API endpoints and Static Bootstrap Site

Jay (Vijayasimha BR)
2 min readJul 18, 2022

--

john wick is…the babayaga.

For the next 2 to 3 months, assuming nothing else goes wrong, I am teaching a bunch of fresher students full stack MERN development for an Edtech company. Here, I write about setting up a basic node JS server that serves a basic API and also a simple bootstrap site.

Of course, you have to install node js from the official website. I will let you Bing or google, how to do that, on your own. Also, you need to know JavaScript already. Please…please dont try to do node JS without knowing JavaScript first and some basic Bootstrap and stuff.

Also, GitHub. Of course.

As always, the full code is available, on my GitHub.

Right then, let’s start our engines!!!!

Part One : all the commands man.

Start by creating an empty folder. Give whatever name you want.

Then, run the following bunch of commands to get everything necessary package. Use the terminal in VS code or any terminal software of your choice.

Part Two : files to create and update

This is the tricky part. I cannot put every file here, but the main ones, are like this. Create each file in the root folder, and start adding the following stuff.

Note : file names are in the bottom left corner, where you have the ‘love’ by GitHub symbol. Please ensure that you use those file names.

your package.json file might appear a little different, but should be similar or identical.

Part Three : Dump a simple bootstrap site

So, we need to serve an entire ‘static’ website. Just take an old school vanilla JS and vanilla Bootstrap site that you have built and add it to the root folder.

You can also, just download something from my own GitHub website, here.

After this, just run the site. Boom!

Final Note

As always, programming is frustrating. Restart. Delete. Restart again. You will get there.

I work as a full time freelance coding tutor. Hire me at UpWork or Fiverr or Stack Overflow. My personal website is here. Find more of my art at Behance and Unsplash. Also, I have a Podcast about everyday life. And, a 2nd Podcast, where I talk about freelancing.

--

--

No responses yet