Comparing version 1.0.0 to 1.1.0
@@ -8,2 +8,6 @@ 'use strict'; | ||
var _compression = require('compression'); | ||
var _compression2 = _interopRequireDefault(_compression); | ||
var _key = require('utilise/key'); | ||
@@ -37,3 +41,3 @@ | ||
if (!server || !dir) return ripple; | ||
expressify(server).use((0, _serveStatic2.default)((0, _path.resolve)(dir, './pages'))); | ||
expressify(server).use((0, _compression2.default)(), (0, _serveStatic2.default)((0, _path.resolve)(dir, './pages'), { redirect: false })).use('*', (0, _compression2.default)(), (0, _serveStatic2.default)((0, _path.resolve)(dir, './pages'))); | ||
return ripple; | ||
@@ -40,0 +44,0 @@ } |
{ | ||
"name": "rijs.pages", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"main": "dist", | ||
@@ -14,5 +14,4 @@ "browser": "./node_modules/utilise/identity.js", | ||
"babel": "babel src -d dist", | ||
"copy": "cp ./node_modules/rijs/dist/ripple* ./dist", | ||
"clean": "rm -rf dist && mkdir dist", | ||
"build": "npm run clean && npm run babel && npm run ignore && npm run copy", | ||
"build": "npm run clean && npm run babel && npm run ignore", | ||
"test": "istanbul test ./node_modules/mocha/bin/_mocha --report html -- -R spec", | ||
@@ -40,4 +39,5 @@ "coverage": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && rm -rf ./coverage", | ||
"dependencies": { | ||
"compression": "^1.6.2", | ||
"utilise": "*" | ||
} | ||
} |
@@ -9,3 +9,4 @@ // ------------------------------------------- | ||
expressify(server) | ||
.use(serve(resolve(dir, './pages'))) | ||
.use(compression(), serve(resolve(dir, './pages'), { redirect: false })) | ||
.use('*', compression(), serve(resolve(dir, './pages'))) | ||
return ripple | ||
@@ -18,2 +19,3 @@ } | ||
import compression from 'compression' | ||
import key from 'utilise/key' | ||
@@ -20,0 +22,0 @@ import { resolve } from 'path' |
29
test.js
@@ -24,9 +24,30 @@ var expect = require('chai').expect | ||
it('should serve pages - miss', function(done){ | ||
it('should serve pages - miss file', function(done){ | ||
request(app) | ||
.get('/404.html') | ||
.expect('Cannot GET /404.html\n') | ||
.expect(404, done) | ||
.get('/missing-path') | ||
.expect('Location', '/missing-path/') | ||
.expect(301, done) | ||
}) | ||
it('should serve pages - miss path', function(done){ | ||
request(app) | ||
.get('/missing-path/') | ||
.expect('<h1>Hello World</h1>') | ||
.expect(200, done) | ||
}) | ||
it('should default to index', function(done){ | ||
request(app) | ||
.get('/') | ||
.expect('<h1>Hello World</h1>') | ||
.expect(200, done) | ||
}) | ||
it('should serve other assets', function(done){ | ||
request(app) | ||
.get('/foo.txt') | ||
.expect('foo') | ||
.expect(200, done) | ||
}) | ||
}) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 2 instances in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
1
0
2
5708
2
10
94
+ Addedcompression@^1.6.2
+ Addedbytes@3.1.2(transitive)
+ Addedcompressible@2.0.18(transitive)
+ Addedcompression@1.7.5(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addedmime-db@1.53.0(transitive)
+ Addedms@2.0.0(transitive)
+ Addednegotiator@0.6.4(transitive)
+ Addedon-headers@1.0.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedvary@1.1.2(transitive)