Exploration of Thoughts: Express JS

 What is Express ?

This is the Javascript framework that speeds up the process of building and deploying web applications.

There is no real meaning in this definition other than words I recall reading in books and articles

How express changed how I do things?

As we learn how to code, we solve problems and construct things, but they are isolated solutions. Typical examples include a login form, virtual keyboard, or todolist. As I made this, I felt incomplete (I am still learning Javascript). When I reload the page, everything was null. No tasks in the todo list, no data in the virtual keyboard, and the login form is just a template.

i attempted to make Habitica clones with vanilla Javascript. it works, but was a mess from files, folders, and code. the code is on github. link


Major things I wanted to do but cannot with Vanilla Javascript.

  • Store some data.
  • Organized Project (with proper links that always work)
  • Error Handling  Like this
  • Other people's API in project 

Express has all the solutions for these things


They all work togethor in web app. 

1. Database
Any database can be connected to your project with express, whether it's a custom json database or Mongdb.

2. Routers
The current way I build projects is with static routing. Click the link and you will be taken somewhere else. Express's dynamic routing gives me a new dimension. Suppose a certain page on my website isn't working. I can change the link on other pages at one place and that will affect the entire site.

Also You can set template for error 404. 

3. Organized
In express, each element of the project has its own file. 

-public
  ----images
  ----javascript
  ----css

-routes
  ----welcome.js
  ----login.js

-views
----layout
------------index
------------------pages
-----------------------navigation
-----------------------footer
-----------------------scripts 
----pages
------------welcome
------------login









Comments

Popular posts from this blog

My Education

React: The Virtual DOM