Skip to content

Commit fe6c727

Browse files
committed
Update README.md
1 parent 15a9000 commit fe6c727

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2152,7 +2152,7 @@ pm2 start app.js
21522152

21532153
**6. serve-favicon:**
21542154

2155-
Node.js middleware for serving a favicon. The `serve-favicon` module lets us exclude requests for the favicon in our logger middleware. It also caches the icon in memory to improve performance by reducing disk access. In addition, it provides an `ETag` based on the contents of the icon, rather than file system properties.
2155+
Node.js middleware for serving a favicon. It create new middleware to serve a favicon from the given path to a favicon file. **path** may also be a Buffer of the icon to serve.
21562156

21572157
**Installation:**
21582158

@@ -2180,19 +2180,19 @@ app.listen(3000)
21802180

21812181
**7. cors:**
21822182

2183-
**C**ross-**O**rigin **R**esource **S**haring (CORS) headers allow apps running in the browser to make requests to servers on different domains (also known as origins). CORS headers are set on the server side - the HTTP server is responsible for indicating that a given HTTP request can be cross-origin. CORS defines a way in which a browser and server can interact and determine whether or not it is safe to allow a cross-origin request.
2183+
**C**ross-**O**rigin **R**esource **S**haring (CORS) headers allow apps running in the browser to make requests to servers on different domains (also known as origins). CORS headers are set on the server side - the HTTP server is responsible for indicating that a given HTTP request can be cross-origin.
21842184

21852185
**Installation:**
21862186

21872187
```js
21882188
npm install cors
21892189
```
21902190

2191-
**Example:** Enable CORS for a Single Route
2191+
**Example:**
21922192

21932193
```js
21942194
/**
2195-
* cors
2195+
* Enable CORS for a Single Route
21962196
*/
21972197
const express = require('express')
21982198
const cors = require('cors')
@@ -2231,7 +2231,6 @@ DB_PASS=root
22312231
/**
22322232
* config.js
22332233
*/
2234-
22352234
const db = require('db')
22362235

22372236
db.connect({
@@ -2254,9 +2253,11 @@ npm install fs-extra
22542253
**Usage:**
22552254

22562255
```js
2256+
/**
2257+
* fs-extra
2258+
*/
22572259
const fs = require('fs-extra')
22582260

2259-
22602261
// Async with callbacks:
22612262
fs.copy('/tmp/myfile', '/tmp/mynewfile', err => {
22622263
if (err) return console.error(err)
@@ -2281,9 +2282,9 @@ npm install moment --save
22812282
```js
22822283
const moment = require('moment');
22832284

2284-
moment().format('MMMM Do YYYY, h:mm:ss a'); // October 24th 2020, 3:15:22 pm
2285+
moment().format('MMMM Do YYYY, h:mm:ss a'); // October 24th 2022, 3:15:22 pm
22852286
moment().format('dddd'); // Saturday
2286-
moment().format("MMM Do YY"); // Oct 24th 20
2287+
moment().format("MMM Do YY"); // Oct 24th 22
22872288
```
22882289

22892290
* Relative Time
@@ -2301,7 +2302,7 @@ moment().startOf('day').fromNow(); // 15 hours ago
23012302
```js
23022303
const moment = require('moment');
23032304

2304-
moment().subtract(10, 'days').calendar(); // 10/14/2020
2305+
moment().subtract(10, 'days').calendar(); // 10/14/2022
23052306
moment().subtract(6, 'days').calendar(); // Last Sunday at 3:18 PM
23062307
moment().subtract(3, 'days').calendar(); // Last Wednesday at 3:18 PM
23072308
```

0 commit comments

Comments
 (0)