refactor: Remove require
extension filename
This commit is contained in:
parent
41f34735a1
commit
aca01f064d
10 changed files with 24 additions and 25 deletions
6
app.js
6
app.js
|
@ -22,9 +22,9 @@ var flash = require('connect-flash')
|
||||||
var getImageMimeType = require('./lib/utils.js').getImageMimeType
|
var getImageMimeType = require('./lib/utils.js').getImageMimeType
|
||||||
|
|
||||||
// core
|
// core
|
||||||
var config = require('./lib/config.js')
|
var config = require('./lib/config')
|
||||||
var logger = require('./lib/logger.js')
|
var logger = require('./lib/logger')
|
||||||
var response = require('./lib/response.js')
|
var response = require('./lib/response')
|
||||||
var models = require('./lib/models')
|
var models = require('./lib/models')
|
||||||
|
|
||||||
// generate front-end constants by template
|
// generate front-end constants by template
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
// external modules
|
// external modules
|
||||||
|
|
||||||
// core
|
// core
|
||||||
var config = require('./config.js')
|
var config = require('./config')
|
||||||
var logger = require('./logger.js')
|
var logger = require('./logger')
|
||||||
var response = require('./response.js')
|
var response = require('./response')
|
||||||
var models = require('./models')
|
var models = require('./models')
|
||||||
|
|
||||||
// public
|
// public
|
||||||
|
|
|
@ -5,8 +5,8 @@ var path = require('path')
|
||||||
var Sequelize = require('sequelize')
|
var Sequelize = require('sequelize')
|
||||||
|
|
||||||
// core
|
// core
|
||||||
var config = require('../config.js')
|
var config = require('../config')
|
||||||
var logger = require('../logger.js')
|
var logger = require('../logger')
|
||||||
|
|
||||||
var dbconfig = config.db
|
var dbconfig = config.db
|
||||||
dbconfig.logging = config.debug ? logger.info : false
|
dbconfig.logging = config.debug ? logger.info : false
|
||||||
|
|
|
@ -15,11 +15,11 @@ var dmp = new DiffMatchPatch()
|
||||||
var S = require('string')
|
var S = require('string')
|
||||||
|
|
||||||
// core
|
// core
|
||||||
var config = require('../config.js')
|
var config = require('../config')
|
||||||
var logger = require('../logger.js')
|
var logger = require('../logger')
|
||||||
|
|
||||||
// ot
|
// ot
|
||||||
var ot = require('../ot/index.js')
|
var ot = require('../ot')
|
||||||
|
|
||||||
// permission types
|
// permission types
|
||||||
var permissionTypes = ['freely', 'editable', 'limited', 'locked', 'protected', 'private']
|
var permissionTypes = ['freely', 'editable', 'limited', 'locked', 'protected', 'private']
|
||||||
|
|
|
@ -7,8 +7,8 @@ var childProcess = require('child_process')
|
||||||
var shortId = require('shortid')
|
var shortId = require('shortid')
|
||||||
|
|
||||||
// core
|
// core
|
||||||
var config = require('../config.js')
|
var config = require('../config')
|
||||||
var logger = require('../logger.js')
|
var logger = require('../logger')
|
||||||
|
|
||||||
var dmpWorker = createDmpWorker()
|
var dmpWorker = createDmpWorker()
|
||||||
var dmpCallbackCache = {}
|
var dmpCallbackCache = {}
|
||||||
|
|
|
@ -5,8 +5,8 @@ var Sequelize = require('sequelize')
|
||||||
var scrypt = require('scrypt')
|
var scrypt = require('scrypt')
|
||||||
|
|
||||||
// core
|
// core
|
||||||
var logger = require('../logger.js')
|
var logger = require('../logger')
|
||||||
var letterAvatars = require('../letter-avatars.js')
|
var letterAvatars = require('../letter-avatars')
|
||||||
|
|
||||||
module.exports = function (sequelize, DataTypes) {
|
module.exports = function (sequelize, DataTypes) {
|
||||||
var User = sequelize.define('User', {
|
var User = sequelize.define('User', {
|
||||||
|
|
|
@ -12,13 +12,13 @@ var chance = new Chance()
|
||||||
var moment = require('moment')
|
var moment = require('moment')
|
||||||
|
|
||||||
// core
|
// core
|
||||||
var config = require('./config.js')
|
var config = require('./config')
|
||||||
var logger = require('./logger.js')
|
var logger = require('./logger')
|
||||||
var history = require('./history.js')
|
var history = require('./history')
|
||||||
var models = require('./models')
|
var models = require('./models')
|
||||||
|
|
||||||
// ot
|
// ot
|
||||||
var ot = require('./ot/index.js')
|
var ot = require('./ot')
|
||||||
|
|
||||||
// public
|
// public
|
||||||
var realtime = {
|
var realtime = {
|
||||||
|
|
|
@ -10,8 +10,8 @@ var request = require('request')
|
||||||
var moment = require('moment')
|
var moment = require('moment')
|
||||||
|
|
||||||
// core
|
// core
|
||||||
var config = require('./config.js')
|
var config = require('./config')
|
||||||
var logger = require('./logger.js')
|
var logger = require('./logger')
|
||||||
var models = require('./models')
|
var models = require('./models')
|
||||||
|
|
||||||
// public
|
// public
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
const Router = require('express').Router
|
const Router = require('express').Router
|
||||||
|
|
||||||
const {urlencodedParser} = require('./utils')
|
const {urlencodedParser} = require('./utils')
|
||||||
const history = require('../history.js')
|
const history = require('../history')
|
||||||
|
|
||||||
const historyRouter = module.exports = Router()
|
const historyRouter = module.exports = Router()
|
||||||
|
|
||||||
// get history
|
// get history
|
||||||
|
|
|
@ -4,8 +4,8 @@ var DiffMatchPatch = require('diff-match-patch')
|
||||||
var dmp = new DiffMatchPatch()
|
var dmp = new DiffMatchPatch()
|
||||||
|
|
||||||
// core
|
// core
|
||||||
var config = require('../config.js')
|
var config = require('../config')
|
||||||
var logger = require('../logger.js')
|
var logger = require('../logger')
|
||||||
|
|
||||||
process.on('message', function (data) {
|
process.on('message', function (data) {
|
||||||
if (!data || !data.msg || !data.cacheKey) {
|
if (!data || !data.msg || !data.cacheKey) {
|
||||||
|
|
Loading…
Reference in a new issue