Make eslint happy

This commit is contained in:
Kristian Dupont 2016-11-16 21:18:08 +01:00
parent bb837b4580
commit 14a62e5f76
2 changed files with 43 additions and 3 deletions

View File

@ -1,6 +1,25 @@
////////////////////////////////////////////////////////////////////////////
//
// Copyright 2016 Realm Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////
'use strict';
var express = require('express'),
util = require('util'),
winston = require('winston');
winston = require('winston'),
RealmWinston = require('./winston-realm').Realm;
var app = express();
@ -14,12 +33,13 @@ app.get('/', function (req, res) {
winston.info('Handled Hello World');
});
app.use(function (req, res, next) {
app.use(function (req, res) {
res.status(404).send('Sorry can not find that!');
winston.error('404 Error at: ' + req.url);
})
app.listen(3000, function () {
// eslint-disable-next-line no-console
console.log('Example app listening on port 3000!');
});

View File

@ -1,3 +1,21 @@
////////////////////////////////////////////////////////////////////////////
//
// Copyright 2016 Realm Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////
'use strict';
var Realm = require('realm');
@ -10,6 +28,8 @@ let winstonRealm = new Realm({
winstonRealm.objects('Log').filtered('level = "error"').addListener((logs, changes) => {
changes.insertions.map((index) => {
let log = logs[index];
// eslint-disable-next-line no-console
console.log(log.message);
})
});