forked from mirrors/Scribe.js
Enabling socket from httpserver
This commit is contained in:
parent
b29dcb6a6c
commit
2f001dd06c
46 changed files with 1000 additions and 23813 deletions
281
.scriberc
281
.scriberc
|
@ -1,141 +1,144 @@
|
||||||
{
|
{
|
||||||
"app": "Scribe",
|
"app": "Scribe",
|
||||||
"id": "instance-0",
|
"id": "instance-0",
|
||||||
"handleUncaughtException": true,
|
"handleUncaughtException": true,
|
||||||
"reader": "reader/BasicConsole",
|
"reader": "reader/BasicConsole",
|
||||||
"expose": {
|
"expose": {
|
||||||
"default": [
|
"default": [
|
||||||
"mongo-socket",
|
"mongo-socket",
|
||||||
"bash"
|
"bash"
|
||||||
],
|
],
|
||||||
"express": [
|
"express": [
|
||||||
"express-mongo-socket",
|
"express-mongo-socket",
|
||||||
"express-bash"
|
"express-bash"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"expose/pipeline": {
|
"expose/pipeline": {
|
||||||
"mongo-socket": [
|
"mongo-socket": [
|
||||||
"transform/ErrorExtractor",
|
"transform/ErrorExtractor",
|
||||||
"transform/ToJSON2",
|
"transform/ToJSON2",
|
||||||
"transform/FullTextSerialize",
|
"transform/FullTextSerialize",
|
||||||
"writer/MongoDB",
|
"writer/MongoDB",
|
||||||
"writer/SocketIO"
|
"writer/SocketIO"
|
||||||
],
|
],
|
||||||
"express-mongo-socket": [
|
"express-mongo-socket": [
|
||||||
"transform/ExpressExtractor",
|
"transform/ExpressExtractor",
|
||||||
"transform/ErrorExtractor",
|
"transform/ErrorExtractor",
|
||||||
"transform/ToJSON2",
|
"transform/ToJSON2",
|
||||||
"transform/FullTextSerialize",
|
"transform/FullTextSerialize",
|
||||||
"writer/MongoDB",
|
"writer/MongoDB",
|
||||||
"writer/SocketIO"
|
"writer/SocketIO"
|
||||||
],
|
],
|
||||||
"bash": [
|
"bash": [
|
||||||
"transform/Inspector",
|
"transform/Inspector",
|
||||||
"writer/DefaultConsole"
|
"writer/DefaultConsole"
|
||||||
],
|
],
|
||||||
"express-bash": [
|
"express-bash": [
|
||||||
"transform/ExpressExtractor",
|
"transform/ExpressExtractor",
|
||||||
"transform/ExpressInspector",
|
"transform/ExpressInspector",
|
||||||
"transform/Inspector",
|
"transform/Inspector",
|
||||||
"writer/DefaultConsole"
|
"writer/DefaultConsole"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"module": {
|
"module": {
|
||||||
"middleware/ExpressLogger": {
|
"middleware/ExpressRequestLogger": {
|
||||||
"expose": "express",
|
"expose": "express",
|
||||||
"ignore": ["(scribe)"]
|
"ignore": [
|
||||||
},
|
"(scribe)"
|
||||||
"writer/MongoDB": {
|
]
|
||||||
"uri": "mongodb://localhost/scribe"
|
},
|
||||||
},
|
"writer/MongoDB": {
|
||||||
"writer/SocketIO": {
|
"uri": "mongodb://localhost/scribe"
|
||||||
"port": 4000,
|
},
|
||||||
"options": {}
|
"writer/SocketIO": {
|
||||||
},
|
"port": 4000,
|
||||||
"transform/Inspector": {
|
"options": {
|
||||||
"colors": true,
|
}
|
||||||
"showHidden": false,
|
},
|
||||||
"depth": 5,
|
"transform/Inspector": {
|
||||||
"pre": true,
|
"colors": true,
|
||||||
"callsite": true,
|
"showHidden": false,
|
||||||
"tags": true,
|
"depth": 5,
|
||||||
"args": true,
|
"pre": true,
|
||||||
"metrics": true
|
"callsite": true,
|
||||||
},
|
"tags": true,
|
||||||
"router/Viewer": {
|
"args": true,
|
||||||
"mongoUri": "mongodb://localhost/scribe",
|
"metrics": true
|
||||||
"basePath": "/scribe",
|
},
|
||||||
"username": "build",
|
"router/Viewer": {
|
||||||
"password": "build",
|
"mongoUri": "mongodb://localhost/scribe",
|
||||||
"authentication": true,
|
"basePath": "/scribe",
|
||||||
"sessionSecret": "scribe-session",
|
"username": "build",
|
||||||
"useBodyParser": true,
|
"password": "build",
|
||||||
"useSession": true
|
"sessionSecret": "scribe-session",
|
||||||
},
|
"useBodyParser": true,
|
||||||
"router/Viewer/native": {
|
"useSession": true
|
||||||
"protocol": "",
|
},
|
||||||
"host": "",
|
"router/Viewer/native": {
|
||||||
"port": "",
|
"protocol": "",
|
||||||
"pathname": ""
|
"host": "",
|
||||||
},
|
"port": "",
|
||||||
"router/Viewer/client": {
|
"pathname": ""
|
||||||
"background": "#222",
|
},
|
||||||
"socketPorts": [
|
"router/Viewer/client": {
|
||||||
4000
|
"background": "#222",
|
||||||
],
|
"socketPorts": [
|
||||||
"socketOptions": {},
|
4000
|
||||||
"queries": {
|
],
|
||||||
"all": {
|
"socketOptions": {
|
||||||
"label": "all",
|
},
|
||||||
"query": {
|
"queries": {
|
||||||
"expose": {
|
"all": {
|
||||||
"$exists": true
|
"label": "all",
|
||||||
}
|
"query": {
|
||||||
}
|
"expose": {
|
||||||
},
|
"$exists": true
|
||||||
"error": {
|
}
|
||||||
"label": "error",
|
}
|
||||||
"query": {
|
},
|
||||||
"expose": "error"
|
"error": {
|
||||||
},
|
"label": "error",
|
||||||
"color": "red"
|
"query": {
|
||||||
},
|
"expose": "error"
|
||||||
"express": {
|
},
|
||||||
"label": "express",
|
"color": "red"
|
||||||
"query": {
|
},
|
||||||
"expose": "express"
|
"express": {
|
||||||
},
|
"label": "express",
|
||||||
"color": "blue"
|
"query": {
|
||||||
},
|
"expose": "express"
|
||||||
"info": {
|
},
|
||||||
"label": "info",
|
"color": "blue"
|
||||||
"query": {
|
},
|
||||||
"expose": "info"
|
"info": {
|
||||||
},
|
"label": "info",
|
||||||
"color": "cyan"
|
"query": {
|
||||||
},
|
"expose": "info"
|
||||||
"log": {
|
},
|
||||||
"label": "log",
|
"color": "cyan"
|
||||||
"query": {
|
},
|
||||||
"expose": "log"
|
"log": {
|
||||||
},
|
"label": "log",
|
||||||
"color": "green"
|
"query": {
|
||||||
},
|
"expose": "log"
|
||||||
"warn": {
|
},
|
||||||
"label": "warn",
|
"color": "green"
|
||||||
"query": {
|
},
|
||||||
"expose": "warn"
|
"warn": {
|
||||||
},
|
"label": "warn",
|
||||||
"color": "yellow"
|
"query": {
|
||||||
},
|
"expose": "warn"
|
||||||
"trace": {
|
},
|
||||||
"label": "trace",
|
"color": "yellow"
|
||||||
"query": {
|
},
|
||||||
"expose": "trace"
|
"trace": {
|
||||||
},
|
"label": "trace",
|
||||||
"color": "magenta"
|
"query": {
|
||||||
}
|
"expose": "trace"
|
||||||
}
|
},
|
||||||
}
|
"color": "magenta"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
16
.travis.yml
16
.travis.yml
|
@ -1,14 +1,14 @@
|
||||||
language: node_js
|
language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- "4.1.0"
|
- "5"
|
||||||
- "4.2.0"
|
|
||||||
- "4.0.0"
|
|
||||||
- "5.0"
|
|
||||||
- "5.1"
|
- "5.1"
|
||||||
- "5.2"
|
- "4"
|
||||||
- "5.3"
|
- "4.2"
|
||||||
- "5.4"
|
- "4.1"
|
||||||
- "5.5"
|
- "4.0"
|
||||||
|
- "0.12"
|
||||||
|
- "0.11"
|
||||||
|
- "iojs"
|
||||||
services:
|
services:
|
||||||
- mongodb
|
- mongodb
|
||||||
script: npm run tests
|
script: npm run tests
|
53
Gruntfile.js
53
Gruntfile.js
|
@ -4,10 +4,10 @@ module.exports = function (grunt) {
|
||||||
require('time-grunt')(grunt);
|
require('time-grunt')(grunt);
|
||||||
require('load-grunt-tasks')(grunt);
|
require('load-grunt-tasks')(grunt);
|
||||||
|
|
||||||
grunt.initConfig({
|
const gruntConfig = {
|
||||||
uglify: {
|
uglify: {
|
||||||
options: {
|
options: {
|
||||||
banner: '/*! Grunt Uglify <%= grunt.template.today("yyyy-mm-dd") %> */ ',
|
banner: '/*! Grunt Uglify <%= grunt.template.today(\'yyyy-mm-dd\') %> */ ',
|
||||||
compress: {
|
compress: {
|
||||||
drop_console: true
|
drop_console: true
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ module.exports = function (grunt) {
|
||||||
files: [{
|
files: [{
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: 'src/',
|
cwd: 'src/',
|
||||||
src: ['**/*.js','*.js'],
|
src: ['**/*.js', '*.js'],
|
||||||
dest: 'dist/',
|
dest: 'dist/',
|
||||||
ext: '.js'
|
ext: '.js'
|
||||||
}]
|
}]
|
||||||
|
@ -66,9 +66,9 @@ module.exports = function (grunt) {
|
||||||
browserify: {
|
browserify: {
|
||||||
dist: {
|
dist: {
|
||||||
options: {
|
options: {
|
||||||
transform: ["babelify"],
|
transform: ['babelify'],
|
||||||
browserifyOptions: {
|
browserifyOptions: {
|
||||||
debug: true, // source mapping
|
debug: false, // source mapping
|
||||||
ignoreMTime: true
|
ignoreMTime: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -84,7 +84,7 @@ module.exports = function (grunt) {
|
||||||
options: {
|
options: {
|
||||||
watch: true,
|
watch: true,
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
transform: ["babelify"],
|
transform: ['babelify'],
|
||||||
browserifyOptions: {
|
browserifyOptions: {
|
||||||
debug: true, // source mapping
|
debug: true, // source mapping
|
||||||
ignoreMTime: true
|
ignoreMTime: true
|
||||||
|
@ -104,8 +104,8 @@ module.exports = function (grunt) {
|
||||||
map: false,
|
map: false,
|
||||||
processors: [
|
processors: [
|
||||||
require('autoprefixer')({
|
require('autoprefixer')({
|
||||||
browsers: ['> 1%']
|
browsers: ['> 1%']
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
dist: {
|
dist: {
|
||||||
|
@ -143,42 +143,15 @@ module.exports = function (grunt) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
clean: ["public/", "./package.noDevDeps.json", "dist/"]
|
clean: ['public/', 'dist/']
|
||||||
});
|
};
|
||||||
|
|
||||||
var lastNodeEnv;
|
grunt.initConfig(gruntConfig);
|
||||||
grunt.registerTask('env-force-production', '', function () {
|
|
||||||
lastNodeEnv = process.env.NODE_ENV;
|
|
||||||
process.env.NODE_ENV = 'production';
|
|
||||||
});
|
|
||||||
|
|
||||||
grunt.registerTask('env-restore', '', function () {
|
|
||||||
process.env.NODE_ENV = lastNodeEnv;
|
|
||||||
});
|
|
||||||
|
|
||||||
grunt.registerTask('get-deps', '', function () {
|
|
||||||
var done = this.async();
|
|
||||||
var pkg = require('./package.json');
|
|
||||||
var fs = require('fs');
|
|
||||||
var exec = require('child_process').exec;
|
|
||||||
|
|
||||||
delete pkg.devDependencies;
|
|
||||||
|
|
||||||
fs.writeFileSync('package.noDevDeps.json', JSON.stringify(pkg), "utf8");
|
|
||||||
|
|
||||||
exec('node node_modules/license-report/index.js --package=./package.noDevDeps.json --output=json',
|
|
||||||
function (err, stdout, stderr) {
|
|
||||||
if (err || stderr) console.error(err, stderr);
|
|
||||||
else fs.writeFileSync('deps.json', JSON.stringify(JSON.parse(stdout), null, 2), "utf8");
|
|
||||||
fs.unlinkSync('package.noDevDeps.json');
|
|
||||||
done();
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
grunt.registerTask('styles', ['sass:dist', 'postcss:dist']);
|
grunt.registerTask('styles', ['sass:dist', 'postcss:dist']);
|
||||||
grunt.registerTask('build', ['get-deps', 'sass:dist', 'postcss:dist', 'browserify:dist', 'copy', 'imagemin', 'babel']);
|
grunt.registerTask('build', ['sass:dist', 'postcss:dist', 'browserify:dist', 'copy', 'imagemin', 'babel']);
|
||||||
grunt.registerTask('default', 'build');
|
grunt.registerTask('default', 'build');
|
||||||
grunt.registerTask('watch-scripts', ['browserify:dev']);
|
grunt.registerTask('watch-scripts', ['browserify:dev']);
|
||||||
grunt.registerTask('watch-styles', ['sass:dev', 'watch:sass']);
|
grunt.registerTask('watch-styles', ['sass:dev', 'watch:sass']);
|
||||||
grunt.registerTask('production', ['env-force-production', 'clean', 'build', 'uglify:dist', 'env-restore']);
|
grunt.registerTask('production', ['clean', 'build', 'uglify:dist']);
|
||||||
};
|
};
|
2
Procfile
2
Procfile
|
@ -1 +1 @@
|
||||||
web: node ./herokuapp/app.js
|
web: npm run demo
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
Node.js logging made simple! Online access to logs and more...
|
Node.js logging made simple! Online access to logs and more...
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install scribe@3.0.0-alpha.5
|
npm install scribe@3.0.0-alpha.8
|
||||||
```
|
```
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
import App from './components/App.jsx'
|
|
||||||
import React from 'react'
|
|
||||||
import { render } from 'react-dom'
|
|
||||||
|
|
||||||
render(<App />, document.getElementById('app'));
|
|
|
@ -1,49 +0,0 @@
|
||||||
import React from 'react'
|
|
||||||
import request from 'superagent'
|
|
||||||
import Influx from 'react-influx'
|
|
||||||
import Wave from './Wave'
|
|
||||||
|
|
||||||
const ANIMATION = false;
|
|
||||||
class App extends Influx.Component {
|
|
||||||
constructor(...args) {
|
|
||||||
super(...args);
|
|
||||||
|
|
||||||
this.state = {credentials: {}};
|
|
||||||
}
|
|
||||||
|
|
||||||
_handleSubmit() {
|
|
||||||
request
|
|
||||||
.post(window.location.pathname)
|
|
||||||
.send(this.state.credentials)
|
|
||||||
.end((err, res) => {
|
|
||||||
if (err || res.body.status) return;
|
|
||||||
window.location.href = res.body.data;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
if (ANIMATION) {
|
|
||||||
setTimeout(()=> new Wave().init(), 1500);
|
|
||||||
document.getElementById('footer').style.display = 'block';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_handleChange(key, e) {
|
|
||||||
this.setState({credentials: {...this.state.credentials, [key]: e.target.value}});
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<div className="full">
|
|
||||||
<div className="float">
|
|
||||||
<input className="input" placeholder="USERNAME" onChange={this._handleChange.bind(this, 'username')}/>
|
|
||||||
<input className="input" type="password" placeholder="PASSWORD"
|
|
||||||
onChange={this._handleChange.bind(this, 'password')}/>
|
|
||||||
<div className="button" onClick={this._handleSubmit.bind(this)}>Submit</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default App
|
|
|
@ -1,106 +0,0 @@
|
||||||
export default class Wave {
|
|
||||||
constructor() {
|
|
||||||
this.shapeX = 0.5;
|
|
||||||
this.shapeY = 100;
|
|
||||||
this.shapeZ = 100;
|
|
||||||
this.shapeColor = 0xffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
init() {
|
|
||||||
this.scene = new THREE.Scene();
|
|
||||||
this.camera();
|
|
||||||
this.renderer();
|
|
||||||
this.light();
|
|
||||||
this.floor();
|
|
||||||
|
|
||||||
this.initShape();
|
|
||||||
|
|
||||||
this.render();
|
|
||||||
}
|
|
||||||
|
|
||||||
camera() {
|
|
||||||
this.camera = new THREE.OrthographicCamera(window.innerWidth / -2, window.innerWidth / 2, window.innerHeight / 2, window.innerHeight / -2, 1, 5000);
|
|
||||||
this.camera.position.y = 500;
|
|
||||||
this.camera.position.z = 500;
|
|
||||||
this.camera.position.x = 500;
|
|
||||||
this.camera.updateProjectionMatrix();
|
|
||||||
this.camera.lookAt(this.scene.position);
|
|
||||||
}
|
|
||||||
|
|
||||||
renderer() {
|
|
||||||
this.renderer = new THREE.WebGLRenderer({antialias: true});
|
|
||||||
this.renderer.setSize(window.innerWidth, window.innerHeight);
|
|
||||||
this.renderer.setClearColor(0x202020, 1);
|
|
||||||
this.renderer.shadowMapEnabled = true;
|
|
||||||
this.renderer.shadowMapType = THREE.PCFSoftShadowMap;
|
|
||||||
document.body.appendChild(this.renderer.domElement);
|
|
||||||
}
|
|
||||||
|
|
||||||
light() {
|
|
||||||
var shadowlight = new THREE.DirectionalLight(0xffffff, 0.20);
|
|
||||||
shadowlight.position.set(0, 1000, 0);
|
|
||||||
shadowlight.castShadow = true;
|
|
||||||
shadowlight.shadowDarkness = 0.1;
|
|
||||||
this.scene.add(shadowlight);
|
|
||||||
|
|
||||||
var light = new THREE.DirectionalLight(0xffffff, 1.2);
|
|
||||||
light.position.set(60, 100, 20);
|
|
||||||
this.scene.add(light);
|
|
||||||
}
|
|
||||||
|
|
||||||
floor() {
|
|
||||||
var geometry = new THREE.PlaneGeometry(10000, 10000, 1, 1);
|
|
||||||
var material = new THREE.MeshBasicMaterial({color: 0x202020});
|
|
||||||
this.floor = new THREE.Mesh(geometry, material);
|
|
||||||
this.floor.material.side = THREE.DoubleSide;
|
|
||||||
this.floor.position.y = -150;
|
|
||||||
this.floor.position.x = -1000;
|
|
||||||
this.floor.rotation.x = 90 * Math.PI / 180;
|
|
||||||
this.floor.rotation.y = 0;
|
|
||||||
this.floor.rotation.z = 0;
|
|
||||||
this.floor.doubleSided = true;
|
|
||||||
this.floor.receiveShadow = true;
|
|
||||||
this.scene.add(this.floor);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
initShape() {
|
|
||||||
this.myArray = new THREE.Group();
|
|
||||||
|
|
||||||
this.scene.add(this.myArray);
|
|
||||||
|
|
||||||
this.geometry = new THREE.BoxGeometry(10, 70, 100);
|
|
||||||
this.material = new THREE.MeshLambertMaterial({color: 0x2e2e2e, shading: THREE.FlatShading});
|
|
||||||
|
|
||||||
|
|
||||||
for (var i = 0; i < 100; i++) {
|
|
||||||
this.layer = new THREE.Group();
|
|
||||||
|
|
||||||
this.shape = new THREE.Mesh(this.geometry, this.material);
|
|
||||||
//this.shape.rotation.y = -Math.PI/4;
|
|
||||||
this.shape.position.x = -1500 + (i * 30);
|
|
||||||
this.shape.position.y = -120;
|
|
||||||
this.shape.castShadow = true;
|
|
||||||
this.shape.receiveShadow = false;
|
|
||||||
|
|
||||||
this.layer.add(this.shape);
|
|
||||||
this.scene.add(this.layer);
|
|
||||||
|
|
||||||
this.tl = new TimelineMax({repeat: -1, delay: i * 0.05, repeatDelay: 1});
|
|
||||||
this.tl.to(this.shape.position, 0.5, {
|
|
||||||
y: 0,
|
|
||||||
ease: Power1.easeInOut
|
|
||||||
});
|
|
||||||
this.tl.to(this.shape.position, 0.5, {
|
|
||||||
y: -120,
|
|
||||||
ease: Power1.easeInOut
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
requestAnimationFrame(this.render.bind(this));
|
|
||||||
this.renderer.render(this.scene, this.camera);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ class App extends Influx.Component {
|
||||||
render() {
|
render() {
|
||||||
const {entries} = this.state;
|
const {entries} = this.state;
|
||||||
const length = entries.length;
|
const length = entries.length;
|
||||||
const maxLineChars = String(length).length + 3;
|
const maxLineChars = String(length).length + 2;
|
||||||
|
|
||||||
const rowRenderer = (i, key) => {
|
const rowRenderer = (i, key) => {
|
||||||
const entry = this.state.entries[i];
|
const entry = this.state.entries[i];
|
||||||
|
@ -109,7 +109,7 @@ class App extends Influx.Component {
|
||||||
<div className='full-abs'>
|
<div className='full-abs'>
|
||||||
<div className="full flex vertical" style={{overflow:'hidden'}}>
|
<div className="full flex vertical" style={{overflow:'hidden'}}>
|
||||||
<Header hide={this.state.hideHeader}/>
|
<Header hide={this.state.hideHeader}/>
|
||||||
<div style={{overflow:'scroll',overflowX:'hidden',paddingTop:10}}>
|
<div className="momentum" style={{overflow:'scroll',overflowX:'hidden',paddingTop:10}}>
|
||||||
<ReactListTracked entries={entries} ref='list' useTranslate3d={true} length={length}
|
<ReactListTracked entries={entries} ref='list' useTranslate3d={true} length={length}
|
||||||
itemRenderer={rowRenderer}/>
|
itemRenderer={rowRenderer}/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3,8 +3,11 @@
|
||||||
var Scribe = require('../');
|
var Scribe = require('../');
|
||||||
var express = require('express');
|
var express = require('express');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
|
var http = require('http');
|
||||||
var bodyParser = require('body-parser');
|
var bodyParser = require('body-parser');
|
||||||
var app = express();
|
var app = express();
|
||||||
|
var server = http.createServer(app);
|
||||||
|
var port = process.env.PORT || 5000;
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
"app": 'simple-server',
|
"app": 'simple-server',
|
||||||
|
@ -14,16 +17,18 @@
|
||||||
"uri": process.env.MONGOLAB_URI || "mongodb://localhost/scribe"
|
"uri": process.env.MONGOLAB_URI || "mongodb://localhost/scribe"
|
||||||
},
|
},
|
||||||
"router/Viewer": {
|
"router/Viewer": {
|
||||||
"mongoUri": process.env.MONGOLAB_URI || "mongodb://localhost/scribe"
|
"mongoUri": process.env.MONGOLAB_URI || "mongodb://localhost/scribe",
|
||||||
|
"username": false,
|
||||||
|
"password": false
|
||||||
},
|
},
|
||||||
"writer/SocketIO": {
|
"writer/SocketIO": {
|
||||||
"port": 50000,
|
"server": server,
|
||||||
"options": {}
|
"options": {}
|
||||||
},
|
},
|
||||||
"router/Viewer/client": {
|
"router/Viewer/client": {
|
||||||
"background": "#222",
|
"background": "#222",
|
||||||
"socketPorts": [
|
"socketPorts": [
|
||||||
50000
|
process.env.PORT ? 443 : port
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -31,12 +36,12 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
const console = Scribe.create(options);
|
const console = Scribe.create(options);
|
||||||
const logger = new Scribe.Middleware.ExpressLogger(console);
|
const logger = new Scribe.Middleware.ExpressRequestLogger(console);
|
||||||
const viewer = new Scribe.Router.Viewer(console);
|
const viewer = new Scribe.Router.Viewer(console);
|
||||||
|
|
||||||
console.persistent('tags', ['scribe']);
|
console.persistent('tags', ['scribe']);
|
||||||
|
|
||||||
app.set('port', (process.env.PORT || 5000));
|
app.set('port', port);
|
||||||
|
|
||||||
app.use(logger.getMiddleware());
|
app.use(logger.getMiddleware());
|
||||||
app.use(bodyParser.urlencoded({extended: true}));
|
app.use(bodyParser.urlencoded({extended: true}));
|
||||||
|
@ -77,7 +82,7 @@
|
||||||
console.tag("Test").log("Hi there ! Server date : " + new Date());
|
console.tag("Test").log("Hi there ! Server date : " + new Date());
|
||||||
}, 10 * 60 * 1000);
|
}, 10 * 60 * 1000);
|
||||||
|
|
||||||
app.listen(port, function () {
|
server.listen(port, function () {
|
||||||
console.time().log('Server listening at port ' + port);
|
console.time().log('Server listening at port ' + port);
|
||||||
});
|
});
|
||||||
|
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 228 KiB After Width: | Height: | Size: 228 KiB |
461
deps.json
461
deps.json
|
@ -1,461 +0,0 @@
|
||||||
[
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "JSONStream",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "(MIT OR Apache-2.0)",
|
|
||||||
"link": "git://github.com/dominictarr/JSONStream.git",
|
|
||||||
"comment": "1.1.1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "async",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "git+https://github.com/caolan/async.git",
|
|
||||||
"comment": "1.5.2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "babel-plugin-syntax-async-functions",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-async-functions",
|
|
||||||
"comment": "6.5.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "babel-plugin-syntax-class-properties",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-class-properties",
|
|
||||||
"comment": "6.5.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "babel-plugin-transform-async-functions",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-async-functions",
|
|
||||||
"comment": "6.5.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "babel-plugin-transform-async-to-module-method",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-async-to-module-method",
|
|
||||||
"comment": "6.7.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "babel-plugin-transform-class-properties",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-class-properties",
|
|
||||||
"comment": "6.5.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "babel-plugin-transform-export-default-name",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "BSD-3-Clause",
|
|
||||||
"link": "git+https://github.com/gajus/babel-plugin-transform-export-default-name.git",
|
|
||||||
"comment": "1.0.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "babel-plugin-transform-object-rest-spread",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-rest-spread",
|
|
||||||
"comment": "6.5.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "babel-plugin-transform-runtime",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-runtime",
|
|
||||||
"comment": "6.5.2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "babel-preset-es2015",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "https://github.com/babel/babel/tree/master/packages/babel-preset-es2015",
|
|
||||||
"comment": "6.5.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "babel-preset-react",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "https://github.com/babel/babel/tree/master/packages/babel-preset-react",
|
|
||||||
"comment": "6.5.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "babel-register",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "https://github.com/babel/babel/tree/master/packages/babel-register",
|
|
||||||
"comment": "6.5.2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "babel-runtime",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "https://github.com/babel/babel/tree/master/packages/babel-runtime",
|
|
||||||
"comment": "6.5.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "basic-auth",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "https://github.com/jshttp/basic-auth",
|
|
||||||
"comment": "1.0.3"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "basic-auth-connect",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "https://github.com/expressjs/basic-auth-connect.git",
|
|
||||||
"comment": "1.0.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "bluebird",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "git://github.com/petkaantonov/bluebird.git",
|
|
||||||
"comment": "3.3.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "body-parser",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "https://github.com/expressjs/body-parser",
|
|
||||||
"comment": "1.15.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "brace",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "git://github.com/thlorenz/brace.git",
|
|
||||||
"comment": "0.7.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "callsite",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"link": "http://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz",
|
|
||||||
"comment": "1.0.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "chalk",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "git+https://github.com/chalk/chalk.git",
|
|
||||||
"comment": "1.1.1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "express",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "git://github.com/visionmedia/express",
|
|
||||||
"comment": "4.0.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "extend",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "git+https://github.com/justmoon/node-extend.git",
|
|
||||||
"comment": "3.0.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "format-error",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "git://github.com/endangeredmassa/format-error",
|
|
||||||
"comment": "1.0.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "jade",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "git://github.com/jadejs/jade.git",
|
|
||||||
"comment": "1.11.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "json-fn",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "git://github.com/vkiryukhin/jsonfn.git",
|
|
||||||
"comment": "0.60.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "keymirror",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "Apache-2.0",
|
|
||||||
"link": "https://github.com/STRML/keyMirror",
|
|
||||||
"comment": "0.1.1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "minimongo",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "LGPLv3",
|
|
||||||
"link": "git+https://github.com/mWater/minimongo.git",
|
|
||||||
"comment": "3.8.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "moment",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "https://github.com/moment/moment.git",
|
|
||||||
"comment": "2.11.2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "mongoose",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "git://github.com/Automattic/mongoose.git",
|
|
||||||
"comment": "4.4.3"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "nw-builder",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "git://github.com/mllrsohn/nw-builder.git",
|
|
||||||
"comment": "2.2.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "on-finished",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "https://github.com/jshttp/on-finished",
|
|
||||||
"comment": "2.3.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "rc",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "(BSD-2-Clause OR MIT OR Apache-2.0)",
|
|
||||||
"link": "git+https://github.com/dominictarr/rc.git",
|
|
||||||
"comment": "1.1.6"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "react",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "BSD-3-Clause",
|
|
||||||
"link": "git+https://github.com/facebook/react.git",
|
|
||||||
"comment": "0.14.7"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "react-ace",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "http://github.com/securingsincity/react-ace.git",
|
|
||||||
"comment": "3.1.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "react-datepicker",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "git://github.com/Hacker0x01/react-datepicker.git",
|
|
||||||
"comment": "0.25.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "react-dom",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "BSD-3-Clause",
|
|
||||||
"link": "git+https://github.com/facebook/react.git",
|
|
||||||
"comment": "0.14.7"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "react-influx",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "ISC",
|
|
||||||
"link": "git+https://github.com/bluejamesbond/Influx.js.git",
|
|
||||||
"comment": "1.1.5"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "react-list",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "git+https://github.com/orgsync/react-list.git",
|
|
||||||
"comment": "0.7.14"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "react-object-inspector",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "git+https://github.com/xyc/react-object-inspector.git",
|
|
||||||
"comment": "0.1.6"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "react-prefixr",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "https://github.com/naman34/react-stylePrefixr.git",
|
|
||||||
"comment": "0.1.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "react-spinkit",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "git+https://github.com/KyleAMathews/react-spinkit.git",
|
|
||||||
"comment": "1.1.4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "socket.io",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "git://github.com/Automattic/socket.io",
|
|
||||||
"comment": "1.4.3"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "strip-ansi",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "https://github.com/sindresorhus/strip-ansi",
|
|
||||||
"comment": "3.0.0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "superagent",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "git://github.com/visionmedia/superagent.git",
|
|
||||||
"comment": "1.7.2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"department": "kessler",
|
|
||||||
"relatedTo": "stuff",
|
|
||||||
"name": "underscore",
|
|
||||||
"licensePeriod": "perpetual",
|
|
||||||
"material": "material",
|
|
||||||
"licenseType": "MIT",
|
|
||||||
"link": "git://github.com/jashkenas/underscore.git",
|
|
||||||
"comment": "1.8.3"
|
|
||||||
}
|
|
||||||
]
|
|
85
dist/middleware/ExpressRequestLogger.js
vendored
Normal file
85
dist/middleware/ExpressRequestLogger.js
vendored
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
|
||||||
|
var _getIterator2 = require('babel-runtime/core-js/get-iterator');
|
||||||
|
|
||||||
|
var _getIterator3 = _interopRequireDefault(_getIterator2);
|
||||||
|
|
||||||
|
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
||||||
|
|
||||||
|
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
||||||
|
|
||||||
|
var _createClass2 = require('babel-runtime/helpers/createClass');
|
||||||
|
|
||||||
|
var _createClass3 = _interopRequireDefault(_createClass2);
|
||||||
|
|
||||||
|
var _onFinished = require('on-finished');
|
||||||
|
|
||||||
|
var _onFinished2 = _interopRequireDefault(_onFinished);
|
||||||
|
|
||||||
|
var _time = require('../libs/time');
|
||||||
|
|
||||||
|
var _time2 = _interopRequireDefault(_time);
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var ExpressRequestLogger = function () {
|
||||||
|
function ExpressRequestLogger(scribe) {
|
||||||
|
(0, _classCallCheck3.default)(this, ExpressRequestLogger);
|
||||||
|
|
||||||
|
this.options = scribe.module('middleware/ExpressRequestLogger').options;
|
||||||
|
this.scribe = scribe;
|
||||||
|
}
|
||||||
|
|
||||||
|
(0, _createClass3.default)(ExpressRequestLogger, [{
|
||||||
|
key: 'getMiddleware',
|
||||||
|
value: function getMiddleware() {
|
||||||
|
var scribe = this.scribe;
|
||||||
|
var options = this.options;
|
||||||
|
|
||||||
|
|
||||||
|
return function (req, res, next) {
|
||||||
|
var start = (0, _time2.default)();
|
||||||
|
(0, _onFinished2.default)(res, function () {
|
||||||
|
var originalUrl = req.originalUrl;
|
||||||
|
var _iteratorNormalCompletion = true;
|
||||||
|
var _didIteratorError = false;
|
||||||
|
var _iteratorError = undefined;
|
||||||
|
|
||||||
|
try {
|
||||||
|
for (var _iterator = (0, _getIterator3.default)(options.ignore), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
||||||
|
var k = _step.value;
|
||||||
|
|
||||||
|
if (new RegExp(k).test(originalUrl)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
_didIteratorError = true;
|
||||||
|
_iteratorError = err;
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if (!_iteratorNormalCompletion && _iterator.return) {
|
||||||
|
_iterator.return();
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
if (_didIteratorError) {
|
||||||
|
throw _iteratorError;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
scribe[options.expose]({ req: req, res: res, duration: (0, _time2.default)() - start });
|
||||||
|
});
|
||||||
|
|
||||||
|
next();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
return ExpressRequestLogger;
|
||||||
|
}();
|
||||||
|
|
||||||
|
exports.default = ExpressRequestLogger;
|
6
dist/middleware/index.js
vendored
6
dist/middleware/index.js
vendored
|
@ -4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
||||||
value: true
|
value: true
|
||||||
});
|
});
|
||||||
|
|
||||||
var _ExpressLogger = require('./ExpressLogger');
|
var _ExpressRequestLogger = require('./ExpressRequestLogger');
|
||||||
|
|
||||||
Object.defineProperty(exports, 'ExpressLogger', {
|
Object.defineProperty(exports, 'ExpressRequestLogger', {
|
||||||
enumerable: true,
|
enumerable: true,
|
||||||
get: function get() {
|
get: function get() {
|
||||||
return _interopRequireDefault(_ExpressLogger).default;
|
return _interopRequireDefault(_ExpressRequestLogger).default;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
10
dist/reader/Console.js
vendored
10
dist/reader/Console.js
vendored
|
@ -8,10 +8,6 @@ var _assign = require('babel-runtime/core-js/object/assign');
|
||||||
|
|
||||||
var _assign2 = _interopRequireDefault(_assign);
|
var _assign2 = _interopRequireDefault(_assign);
|
||||||
|
|
||||||
var _promise = require('babel-runtime/core-js/promise');
|
|
||||||
|
|
||||||
var _promise2 = _interopRequireDefault(_promise);
|
|
||||||
|
|
||||||
var _typeof2 = require('babel-runtime/helpers/typeof');
|
var _typeof2 = require('babel-runtime/helpers/typeof');
|
||||||
|
|
||||||
var _typeof3 = _interopRequireDefault(_typeof2);
|
var _typeof3 = _interopRequireDefault(_typeof2);
|
||||||
|
@ -36,6 +32,10 @@ var _async = require('async');
|
||||||
|
|
||||||
var _async2 = _interopRequireDefault(_async);
|
var _async2 = _interopRequireDefault(_async);
|
||||||
|
|
||||||
|
var _bluebird = require('bluebird');
|
||||||
|
|
||||||
|
var _bluebird2 = _interopRequireDefault(_bluebird);
|
||||||
|
|
||||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
var console = function () {
|
var console = function () {
|
||||||
|
@ -148,7 +148,7 @@ var console = function () {
|
||||||
|
|
||||||
this.captureStackTrace();
|
this.captureStackTrace();
|
||||||
|
|
||||||
return new _promise2.default(function (resolve, reject) {
|
return new _bluebird2.default(function (resolve, reject) {
|
||||||
if (!_this2._pipelines[expose]) {
|
if (!_this2._pipelines[expose]) {
|
||||||
return resolve();
|
return resolve();
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,6 @@ function getObject(d, def) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var viewer = _jade2.default.compileFile(__dirname + '/../../views/viewer.jade');
|
var viewer = _jade2.default.compileFile(__dirname + '/../../views/viewer.jade');
|
||||||
var login = _jade2.default.compileFile(__dirname + '/../../views/login.jade');
|
|
||||||
|
|
||||||
var Viewer = function () {
|
var Viewer = function () {
|
||||||
function Viewer(scribe) {
|
function Viewer(scribe) {
|
4
dist/scribe.js
vendored
4
dist/scribe.js
vendored
|
@ -106,8 +106,10 @@ function resolvePipeline(scribe, pipeline) {
|
||||||
return resolved;
|
return resolved;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var defaultOpts = _fs2.default.readFileSync(__dirname + '/../.scriberc', 'utf8');
|
||||||
|
|
||||||
function create(opts) {
|
function create(opts) {
|
||||||
opts = (0, _extend2.default)(true, (0, _rc2.default)('scribe', {}), opts);
|
opts = (0, _extend2.default)(true, (0, _rc2.default)('scribe', JSON.parse(defaultOpts)), opts);
|
||||||
|
|
||||||
// create default console
|
// create default console
|
||||||
var console = new Reader.BasicConsole(opts);
|
var console = new Reader.BasicConsole(opts);
|
||||||
|
|
10
dist/writer/SocketIO.js
vendored
10
dist/writer/SocketIO.js
vendored
|
@ -4,6 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
||||||
value: true
|
value: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var _typeof2 = require('babel-runtime/helpers/typeof');
|
||||||
|
|
||||||
|
var _typeof3 = _interopRequireDefault(_typeof2);
|
||||||
|
|
||||||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
||||||
|
|
||||||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
||||||
|
@ -27,7 +31,11 @@ var SocketIO = function () {
|
||||||
this.options = scribe.module('writer/SocketIO').options;
|
this.options = scribe.module('writer/SocketIO').options;
|
||||||
|
|
||||||
if (!sio) {
|
if (!sio) {
|
||||||
sio = (0, _socket2.default)(this.options.port, this.options.options);
|
if ((0, _typeof3.default)(this.options.server) === 'object') {
|
||||||
|
sio = _socket2.default.listen(this.options.server, this.options.options);
|
||||||
|
} else {
|
||||||
|
sio = (0, _socket2.default)(this.options.port, this.options.options);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ if (cluster.isMaster) {
|
||||||
|
|
||||||
// express
|
// express
|
||||||
const app = express();
|
const app = express();
|
||||||
const logger = new Scribe.Middleware.ExpressLogger(console);
|
const logger = new Scribe.Middleware.ExpressRequestLogger(console);
|
||||||
const viewer = new Scribe.Router.Viewer(console);
|
const viewer = new Scribe.Router.Viewer(console);
|
||||||
|
|
||||||
// express logger
|
// express logger
|
||||||
|
|
|
@ -57,7 +57,7 @@ console.persistent('tags', ['mocha', 'scribe']);
|
||||||
|
|
||||||
// express
|
// express
|
||||||
const app = express();
|
const app = express();
|
||||||
const logger = new Scribe.Middleware.ExpressLogger(console);
|
const logger = new Scribe.Middleware.ExpressRequestLogger(console);
|
||||||
const viewer = new Scribe.Router.Viewer(console);
|
const viewer = new Scribe.Router.Viewer(console);
|
||||||
|
|
||||||
// express logger
|
// express logger
|
||||||
|
|
|
@ -50,7 +50,7 @@ console.pipe('express', 'express-mongo-socket')
|
||||||
|
|
||||||
// express
|
// express
|
||||||
const app = express();
|
const app = express();
|
||||||
const logger = new Scribe.Middleware.ExpressLogger(console);
|
const logger = new Scribe.Middleware.ExpressRequestLogger(console);
|
||||||
const viewer = new Scribe.Router.Viewer(console);
|
const viewer = new Scribe.Router.Viewer(console);
|
||||||
|
|
||||||
// express logger
|
// express logger
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
{
|
{
|
||||||
"name": "scribe-js",
|
"name": "scribe-js",
|
||||||
"description": "Comprehensive logging framework with online interface",
|
"description": "Comprehensive logging framework with online interface",
|
||||||
"version": "3.0.0-alpha.5",
|
"version": "3.0.0-alpha.8",
|
||||||
"homepage": "https://github.com/bluejamesbond/Scribe.js",
|
"homepage": "https://github.com/bluejamesbond/Scribe.js",
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "./node_modules/mocha/bin/mocha --compilers js:babel-register --timeout 15000",
|
"test": "./node_modules/mocha/bin/mocha --compilers js:babel-register --timeout 15000",
|
||||||
"tests": "npm run test ./tests/*.test.js",
|
"tests": "npm run test ./tests/*.test.js",
|
||||||
|
"production": "export NODE_ENV=production; grunt production",
|
||||||
|
"demo": "export NODE_ENV=production; node ./demo/app.js",
|
||||||
"babel-node": "node ./babel-node"
|
"babel-node": "node ./babel-node"
|
||||||
},
|
},
|
||||||
"author": {
|
"author": {
|
||||||
|
@ -93,7 +95,6 @@
|
||||||
"grunt-contrib-uglify": "0.11.1",
|
"grunt-contrib-uglify": "0.11.1",
|
||||||
"grunt-contrib-watch": "0.6.1",
|
"grunt-contrib-watch": "0.6.1",
|
||||||
"grunt-postcss": "0.7.1",
|
"grunt-postcss": "0.7.1",
|
||||||
"license-report": "2.0.0",
|
|
||||||
"load-grunt-tasks": "3.4.0",
|
"load-grunt-tasks": "3.4.0",
|
||||||
"mocha": "2.4.5",
|
"mocha": "2.4.5",
|
||||||
"time-grunt": "1.3.0",
|
"time-grunt": "1.3.0",
|
||||||
|
|
22724
public/scripts/login/Bootstrap.min.js
vendored
22724
public/scripts/login/Bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
2
public/scripts/socket.min.js
vendored
2
public/scripts/socket.min.js
vendored
File diff suppressed because one or more lines are too long
77
public/scripts/viewer/Bootstrap.min.js
vendored
77
public/scripts/viewer/Bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
664
public/styles/login.min.css
vendored
664
public/styles/login.min.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
public/styles/viewer.min.css
vendored
2
public/styles/viewer.min.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,88 +0,0 @@
|
||||||
@import "shared/reset";
|
|
||||||
@import "shared/fonts";
|
|
||||||
@import "shared/base";
|
|
||||||
@import "shared/scroll";
|
|
||||||
@import "shared/layouts";
|
|
||||||
@import "shared/datepicker";
|
|
||||||
|
|
||||||
html, body {
|
|
||||||
background: #000;
|
|
||||||
font-size: 1rem;
|
|
||||||
line-height: 1.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.float {
|
|
||||||
width: 300px;
|
|
||||||
margin: 0 auto;
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
left: 50%;
|
|
||||||
text-align: center;
|
|
||||||
z-index: 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input {
|
|
||||||
background: transparent;
|
|
||||||
border-radius: 50px;
|
|
||||||
padding: 15px 20px;
|
|
||||||
font-size: 70%;
|
|
||||||
letter-spacing: 1px;
|
|
||||||
width: 100%;
|
|
||||||
margin: 5px auto;
|
|
||||||
color: #FFF;
|
|
||||||
border: 1px solid #222;
|
|
||||||
text-align: center;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button {
|
|
||||||
background: #2589DE;
|
|
||||||
border-radius: 30px;
|
|
||||||
color: #FFF;
|
|
||||||
font-size: 70%;
|
|
||||||
width: 50%;
|
|
||||||
margin-top: 10px;
|
|
||||||
text-transform: uppercase;
|
|
||||||
letter-spacing: 1px;
|
|
||||||
text-align: center;
|
|
||||||
cursor: pointer;
|
|
||||||
position: relative;
|
|
||||||
transition: background 50ms;
|
|
||||||
padding: 5px 0;
|
|
||||||
display: inline-block;
|
|
||||||
&.disabled {
|
|
||||||
cursor: none;
|
|
||||||
pointer-events: none;
|
|
||||||
background: #0f3657;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
canvas {
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
bottom: 0;
|
|
||||||
position: fixed;
|
|
||||||
z-index: 0;
|
|
||||||
opacity: 0.3;
|
|
||||||
}
|
|
||||||
|
|
||||||
#footer {
|
|
||||||
color: #3b434c;
|
|
||||||
font-family: 'Proxima Nova', sans-serif;
|
|
||||||
font-size: 14px;
|
|
||||||
padding: 10px;
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
z-index: 100;
|
|
||||||
a {
|
|
||||||
color: white;
|
|
||||||
font-family: 'Proxima Nova', sans-serif;
|
|
||||||
font-style: italic;
|
|
||||||
text-decoration: none;
|
|
||||||
font-weight: 700;
|
|
||||||
margin: 0 5px;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -80,7 +80,7 @@ $secondaryColor: #ae720c;
|
||||||
.react-datepicker__header {
|
.react-datepicker__header {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
background-color: $secondaryColor;
|
background-color: $secondaryColor;
|
||||||
padding-top: 10px;
|
padding-top: 15px;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,11 +88,10 @@ $secondaryColor: #ae720c;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
color: #FFF;
|
color: #FFF;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 9px;
|
font-size: 10px;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
letter-spacing: 1px;
|
letter-spacing: 1px;
|
||||||
position: relative;
|
position: relative;
|
||||||
top: -4px;
|
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,11 +100,11 @@ $secondaryColor: #ae720c;
|
||||||
}
|
}
|
||||||
|
|
||||||
.react-datepicker__navigation {
|
.react-datepicker__navigation {
|
||||||
line-height: 24px;
|
line-height: 32px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 10px;
|
top: 13px;
|
||||||
width: 0;
|
width: 0;
|
||||||
border: 6px solid transparent;
|
border: 6px solid transparent;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,7 @@
|
||||||
|
|
||||||
html, body {
|
html, body {
|
||||||
background: #222;
|
background: #222;
|
||||||
font-size: 0.95rem;
|
font-size: 12px;
|
||||||
line-height: 1.5rem;
|
|
||||||
font-family: 'Proxima Nova', "Helvetica", "Helvetic Neue", "Open Sans", sans-serif;
|
font-family: 'Proxima Nova', "Helvetica", "Helvetic Neue", "Open Sans", sans-serif;
|
||||||
&.blue {
|
&.blue {
|
||||||
background: #242831;
|
background: #242831;
|
||||||
|
@ -48,7 +47,7 @@ html, body {
|
||||||
line-height: 50px;
|
line-height: 50px;
|
||||||
letter-spacing: 1px;
|
letter-spacing: 1px;
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
font-size: 80%;
|
font-size: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
|
@ -57,7 +56,7 @@ html, body {
|
||||||
color: #888;
|
color: #888;
|
||||||
letter-spacing: 1px;
|
letter-spacing: 1px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 90%;
|
font-size: 11px;
|
||||||
&.selected {
|
&.selected {
|
||||||
background: #2589DE;
|
background: #2589DE;
|
||||||
color: white !important;
|
color: white !important;
|
||||||
|
@ -149,7 +148,7 @@ html, body {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
font-size: 80%;
|
font-size: 11px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.raw {
|
.raw {
|
||||||
|
@ -160,7 +159,7 @@ html, body {
|
||||||
border-top: 1px dotted #333;
|
border-top: 1px dotted #333;
|
||||||
border-bottom: 1px dotted #333;
|
border-bottom: 1px dotted #333;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.white {
|
.white {
|
||||||
|
@ -209,7 +208,7 @@ html, body {
|
||||||
margin-right: 3px;
|
margin-right: 3px;
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
font-size: 60%;
|
font-size: 10px;
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 1px;
|
top: 1px;
|
||||||
}
|
}
|
||||||
|
@ -272,7 +271,7 @@ html, body {
|
||||||
margin-right: 3px;
|
margin-right: 3px;
|
||||||
height: 12px;
|
height: 12px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 60%;
|
font-size: 10px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
&.rotate {
|
&.rotate {
|
||||||
transform: rotate(-90deg);
|
transform: rotate(-90deg);
|
||||||
|
@ -298,7 +297,7 @@ html, body {
|
||||||
min-width: 10px;
|
min-width: 10px;
|
||||||
position: relative;
|
position: relative;
|
||||||
left: -15px;
|
left: -15px;
|
||||||
font-size: 80%;
|
font-size: 11px;
|
||||||
top: -1px;
|
top: -1px;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
@ -356,7 +355,7 @@ html, body {
|
||||||
background: #2589DE;
|
background: #2589DE;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
color: #FFF;
|
color: #FFF;
|
||||||
font-size: 70%;
|
font-size: 9px;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
letter-spacing: 1px;
|
letter-spacing: 1px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
@ -511,7 +510,7 @@ html, body {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 8px;
|
right: 8px;
|
||||||
font-size: 80%;
|
font-size: 10px;
|
||||||
top: 0;
|
top: 0;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
line-height: 14px;
|
line-height: 14px;
|
||||||
|
@ -588,4 +587,8 @@ a {
|
||||||
|
|
||||||
.arrow-expand:hover {
|
.arrow-expand:hover {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.momentum {
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
}
|
}
|
|
@ -1,9 +1,9 @@
|
||||||
import onFinish from 'on-finished'
|
import onFinish from 'on-finished'
|
||||||
import time from '../libs/time';
|
import time from '../libs/time';
|
||||||
|
|
||||||
export default class ExpressLogger {
|
export default class ExpressRequestLogger {
|
||||||
constructor(scribe) {
|
constructor(scribe) {
|
||||||
this.options = scribe.module('middleware/ExpressLogger').options;
|
this.options = scribe.module('middleware/ExpressRequestLogger').options;
|
||||||
this.scribe = scribe;
|
this.scribe = scribe;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
export {default as ExpressLogger} from './ExpressLogger';
|
export {default as ExpressRequestLogger} from './ExpressRequestLogger';
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import stack from 'callsite'
|
import stack from 'callsite';
|
||||||
import async from 'async'
|
import async from 'async';
|
||||||
|
import Promise from 'bluebird'
|
||||||
|
|
||||||
export default class {
|
export default class {
|
||||||
constructor(config) {
|
constructor(config) {
|
||||||
|
|
|
@ -26,7 +26,6 @@ function getObject(d, def) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const viewer = jade.compileFile(`${__dirname}/../../views/viewer.jade`);
|
const viewer = jade.compileFile(`${__dirname}/../../views/viewer.jade`);
|
||||||
const login = jade.compileFile(`${__dirname}/../../views/login.jade`);
|
|
||||||
|
|
||||||
export default class Viewer {
|
export default class Viewer {
|
||||||
constructor(scribe) {
|
constructor(scribe) {
|
||||||
|
|
|
@ -31,8 +31,10 @@ export function resolvePipeline(scribe, pipeline) {
|
||||||
return resolved;
|
return resolved;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const defaultOpts = fs.readFileSync(`${__dirname}/../.scriberc`, 'utf8');
|
||||||
|
|
||||||
export function create(opts) {
|
export function create(opts) {
|
||||||
opts = extend(true, rc('scribe', {}), opts);
|
opts = extend(true, rc('scribe', JSON.parse(defaultOpts)), opts);
|
||||||
|
|
||||||
// create default console
|
// create default console
|
||||||
const console = new Reader.BasicConsole(opts);
|
const console = new Reader.BasicConsole(opts);
|
||||||
|
|
|
@ -7,7 +7,11 @@ export default class SocketIO {
|
||||||
this.options = scribe.module('writer/SocketIO').options;
|
this.options = scribe.module('writer/SocketIO').options;
|
||||||
|
|
||||||
if (!sio) {
|
if (!sio) {
|
||||||
sio = io(this.options.port, this.options.options);
|
if (typeof this.options.server === 'object') {
|
||||||
|
sio = io.listen(this.options.server, this.options.options);
|
||||||
|
} else {
|
||||||
|
sio = io(this.options.port, this.options.options);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ describe('Basic Scribe', ()=> {
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
let count = 0, did404 = 0;
|
let count = 0, did404 = 0;
|
||||||
const logger = new Scribe.Middleware.ExpressLogger(console);
|
const logger = new Scribe.Middleware.ExpressRequestLogger(console);
|
||||||
|
|
||||||
app.use(logger.getMiddleware());
|
app.use(logger.getMiddleware());
|
||||||
app.get('/test', (req, res) => {
|
app.get('/test', (req, res) => {
|
||||||
|
|
|
@ -1,55 +0,0 @@
|
||||||
import {Readable,Writable, Transform} from 'stream'
|
|
||||||
import {inspect} from 'util'
|
|
||||||
|
|
||||||
class Console extends Readable {
|
|
||||||
constructor(options = {}, stream) {
|
|
||||||
super(Object.assign(options, {objectMode: true}), stream);
|
|
||||||
}
|
|
||||||
|
|
||||||
_read() {
|
|
||||||
if (Array.isArray(this.content)) {
|
|
||||||
this.push(this.content);
|
|
||||||
this.content = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
out(...args) {
|
|
||||||
this.content = args;
|
|
||||||
this.read();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class Sink extends Writable {
|
|
||||||
constructor(options = {}) {
|
|
||||||
super(Object.assign(options, {objectMode: true}));
|
|
||||||
}
|
|
||||||
|
|
||||||
_write(data, enc, next) {
|
|
||||||
console.log(...data);
|
|
||||||
next();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class Inspect extends Transform {
|
|
||||||
constructor(options = {}) {
|
|
||||||
super(Object.assign(options, {objectMode: true}))
|
|
||||||
}
|
|
||||||
|
|
||||||
_transform(chunk, encoding, callback) {
|
|
||||||
this.push(inspect(chunk, {colors: true}) + '\n');
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
describe('Simple Streams', ()=> {
|
|
||||||
const s = new Console();
|
|
||||||
s.pipe(new Sink());
|
|
||||||
s.pipe(new Inspect()).pipe(process.stdout);
|
|
||||||
|
|
||||||
it('should use streams to transfer data', done => {
|
|
||||||
s.out("new Testing", "multi-arg");
|
|
||||||
s.out("How now brown cow?");
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -1,15 +0,0 @@
|
||||||
doctype html
|
|
||||||
html
|
|
||||||
head
|
|
||||||
meta(charset="UTF-8")
|
|
||||||
link(rel='stylesheet', type='text/css', href='styles/login.min.css')
|
|
||||||
script(src='scripts/three.min.js',defer=true)
|
|
||||||
script(src='scripts/TweenMax.min.js',defer=true)
|
|
||||||
script(src='scripts/login/Bootstrap.min.js',defer=true)
|
|
||||||
style.
|
|
||||||
body,.full {width:100%;height:100%;position:relative;}
|
|
||||||
body
|
|
||||||
#app.full
|
|
||||||
footer#footer(style='display:none')
|
|
||||||
| Animation by
|
|
||||||
a(target='_blank', href='https://twitter.com/QuentinHocde') Quentin Hocdé
|
|
|
@ -3,6 +3,7 @@ html
|
||||||
head
|
head
|
||||||
title Scribe.js
|
title Scribe.js
|
||||||
meta(charset="UTF-8")
|
meta(charset="UTF-8")
|
||||||
|
meta(name="viewport", content="width=device-width, initial-scale=1")
|
||||||
link(rel='stylesheet', type='text/css', href='styles/viewer.min.css')
|
link(rel='stylesheet', type='text/css', href='styles/viewer.min.css')
|
||||||
script.
|
script.
|
||||||
window.config = !{config};
|
window.config = !{config};
|
||||||
|
|
Loading…
Add table
Reference in a new issue