Skip to content

Commit

Permalink
chore: fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyguerra committed Jan 20, 2024
1 parent 03f5bd1 commit 36001d4
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 19 deletions.
15 changes: 8 additions & 7 deletions examples/search/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var express = require('../..');
var path = require('path');
var redis = require('redis');

var db = redis.createClient();
var db = redis.createClient()

// npm install redis

Expand All @@ -24,12 +24,13 @@ var app = express();
app.use(express.static(path.join(__dirname, 'public')));

// populate search

db.sadd('ferret', 'tobi');
db.sadd('ferret', 'loki');
db.sadd('ferret', 'jane');
db.sadd('cat', 'manny');
db.sadd('cat', 'luna');
db.on('ready', function(){
db.sAdd('ferret', 'tobi');
db.sAdd('ferret', 'loki');
db.sAdd('ferret', 'jane');
db.sAdd('cat', 'manny');
db.sAdd('cat', 'luna');
});

/**
* GET search for :query.
Expand Down
16 changes: 10 additions & 6 deletions examples/static-files/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ app.use('/static', express.static(path.join(__dirname, 'public')));
// this will allow "GET /style.css" instead of "GET /css/style.css":
app.use(express.static(path.join(__dirname, 'public', 'css')));

app.listen(process.env.PORT || 3000);
console.log(`listening on port ${process.env.PORT || 3000}`);
console.log('try:');
console.log(' GET /hello.txt');
console.log(' GET /js/app.js');
console.log(' GET /css/style.css');
if (!require.main) {
const server = app.listen();

Check failure on line 39 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (20.x)

Expected indentation of 2 spaces but found 4

Check failure on line 39 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (18.x)

Expected indentation of 2 spaces but found 4

Check failure on line 39 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (19.x)

Expected indentation of 2 spaces but found 4

Check failure on line 39 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (20.x)

Expected indentation of 2 spaces but found 4

Check failure on line 39 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (18.x)

Expected indentation of 2 spaces but found 4

Check failure on line 39 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (19.x)

Expected indentation of 2 spaces but found 4
app.close = () => server.close();

Check failure on line 40 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (20.x)

Expected indentation of 2 spaces but found 4

Check failure on line 40 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (18.x)

Expected indentation of 2 spaces but found 4

Check failure on line 40 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (19.x)

Expected indentation of 2 spaces but found 4

Check failure on line 40 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (20.x)

Expected indentation of 2 spaces but found 4

Check failure on line 40 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (18.x)

Expected indentation of 2 spaces but found 4

Check failure on line 40 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (19.x)

Expected indentation of 2 spaces but found 4
console.log(`Express started on port ${server.address().port}`);

Check failure on line 41 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (20.x)

Expected indentation of 2 spaces but found 4

Check failure on line 41 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (18.x)

Expected indentation of 2 spaces but found 4

Check failure on line 41 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (19.x)

Expected indentation of 2 spaces but found 4

Check failure on line 41 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (20.x)

Expected indentation of 2 spaces but found 4

Check failure on line 41 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (18.x)

Expected indentation of 2 spaces but found 4

Check failure on line 41 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (19.x)

Expected indentation of 2 spaces but found 4
console.log('try:');

Check failure on line 42 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (20.x)

Expected indentation of 2 spaces but found 4

Check failure on line 42 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (18.x)

Expected indentation of 2 spaces but found 4

Check failure on line 42 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (19.x)

Expected indentation of 2 spaces but found 4

Check failure on line 42 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (20.x)

Expected indentation of 2 spaces but found 4

Check failure on line 42 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (18.x)

Expected indentation of 2 spaces but found 4

Check failure on line 42 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (19.x)

Expected indentation of 2 spaces but found 4
console.log(' GET /hello.txt');

Check failure on line 43 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (20.x)

Expected indentation of 2 spaces but found 4

Check failure on line 43 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (18.x)

Expected indentation of 2 spaces but found 4

Check failure on line 43 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (19.x)

Expected indentation of 2 spaces but found 4

Check failure on line 43 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (20.x)

Expected indentation of 2 spaces but found 4

Check failure on line 43 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (18.x)

Expected indentation of 2 spaces but found 4

Check failure on line 43 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (19.x)

Expected indentation of 2 spaces but found 4
console.log(' GET /js/app.js');

Check failure on line 44 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (20.x)

Expected indentation of 2 spaces but found 4

Check failure on line 44 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (18.x)

Expected indentation of 2 spaces but found 4

Check failure on line 44 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (19.x)

Expected indentation of 2 spaces but found 4

Check failure on line 44 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (20.x)

Expected indentation of 2 spaces but found 4

Check failure on line 44 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (18.x)

Expected indentation of 2 spaces but found 4

Check failure on line 44 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (19.x)

Expected indentation of 2 spaces but found 4
console.log(' GET /css/style.css');

Check failure on line 45 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (20.x)

Expected indentation of 2 spaces but found 4

Check failure on line 45 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (18.x)

Expected indentation of 2 spaces but found 4

Check failure on line 45 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (19.x)

Expected indentation of 2 spaces but found 4

Check failure on line 45 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (20.x)

Expected indentation of 2 spaces but found 4

Check failure on line 45 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (18.x)

Expected indentation of 2 spaces but found 4

Check failure on line 45 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (19.x)

Expected indentation of 2 spaces but found 4
}

Check failure on line 47 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (20.x)

Trailing spaces not allowed

Check failure on line 47 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (20.x)

Newline required at end of file but not found

Check failure on line 47 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (18.x)

Trailing spaces not allowed

Check failure on line 47 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (18.x)

Newline required at end of file but not found

Check failure on line 47 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (19.x)

Trailing spaces not allowed

Check failure on line 47 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (19.x)

Newline required at end of file but not found

Check failure on line 47 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (20.x)

Trailing spaces not allowed

Check failure on line 47 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (20.x)

Newline required at end of file but not found

Check failure on line 47 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (18.x)

Trailing spaces not allowed

Check failure on line 47 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (19.x)

Trailing spaces not allowed

Check failure on line 47 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (18.x)

Newline required at end of file but not found

Check failure on line 47 in examples/static-files/index.js

View workflow job for this annotation

GitHub Actions / Fast Tests (19.x)

Newline required at end of file but not found
114 changes: 108 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@
"method-override": "^3.0.0",
"morgan": "^1.10.0",
"multiparty": "^4.2.3",
"online": "^0.0.1",
"pbkdf2-password": "^1.2.1",
"redis": "^4.6.12",
"supertest": "^6.3.3",
"vhost": "^3.0.2"
},
Expand Down

0 comments on commit 36001d4

Please sign in to comment.