Skip to content

Commit

Permalink
How To Use Components in ExpressJS
Browse files Browse the repository at this point in the history
  • Loading branch information
omarbelkady committed Nov 19, 2020
1 parent 95c5e0a commit 9a7805c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
9 changes: 9 additions & 0 deletions Components/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### ExpressJS Components(most imp)
- Request: builds a req object auto, gets populated with imp data such: methods, headers, etc.
- Response: builds a res object which is a HTTP response that gets sent back to the user. Take care of proc req and conv text
into appropriate format and then sends it back to client
- Middleware: A function that gets called during Request-Response cycle and has access to resp and requ objects
- Error Handling: Express comes prepackaged with error handling that will catch any sync/asynch error
- Template: unopionated meaning I can use any templating language: ejs(embedded javascript), jade, etc.
- DB: I can connect to any db using my ExpressJS app by loading the appropriate NodeJS driver for the DB

19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
## ExpressJS
#### What It Is?
- Wep Application development framework based on NodeJS
- Small Framework that does not slow your app down

- routing and middleware web framework For NodeJS
#### What It Does
- Takes care of a lot of common tasks when building a web app:
- parsing Requests
- Routing
- Error Handling


#### Why Use It?
- Fast
- Minimal - Provides you only with the fundamental features for your app
- Unopinioated - no default configurations in order for your to structure your app your own way
- Simple - very easy to use, very simple to: install, use and read documentation
- Unobtrusive - setup ExpressJS they way I want it to be used no prereq libs only libs of my choice

### How To Install
```bash
Expand Down Expand Up @@ -35,4 +50,4 @@ app.delete('/user', function (req, res) {
app.put('/user', function (req, res) {
res.send('Just Made a PUT request for /user')
})
```
```

0 comments on commit 9a7805c

Please sign in to comment.