@@ -51,12 +51,12 @@ const bodyParser = require('body-parser')
5151const errorHandler = require ( 'errorhandler' )
5252
5353// Local files
54- const random = require ( './random_id' )
55- const defargs = require ( './defaultargs' )
54+ // const random = require('./random_id.cjs ')
55+ const defargs = require ( './defaultargs.js ' )
5656const resolveClient = require ( 'wiki-client/lib/resolve' )
57- const pluginsFactory = require ( './plugins' )
58- const sitemapFactory = require ( './sitemap' )
59- const searchFactory = require ( './search' )
57+ const pluginsFactory = require ( './plugins.js ' )
58+ const sitemapFactory = require ( './sitemap.js ' )
59+ const searchFactory = require ( './search.js ' )
6060
6161const render = page => {
6262 return (
@@ -103,7 +103,7 @@ module.exports = exports = argv => {
103103 // defaultargs.coffee exports a function that takes the argv object
104104 // that is passed in and then does its
105105 // best to supply sane defaults for any arguments that are missing.
106- argv = defargs ( argv )
106+ argv = defargs . default ( argv )
107107
108108 app . startOpts = argv
109109
@@ -130,16 +130,16 @@ module.exports = exports = argv => {
130130 }
131131 let pagehandler , sitemaphandler , searchhandler , securityhandler
132132 // Require the database adapter and initialize it with options.
133- app . pagehandler = pagehandler = require ( argv . database . type ) ( argv )
133+ app . pagehandler = pagehandler = require ( argv . database . type ) . default ( argv )
134134
135135 // Require the sitemap adapter and initialize it with options.
136- app . sitemaphandler = sitemaphandler = sitemapFactory ( argv )
136+ app . sitemaphandler = sitemaphandler = sitemapFactory . default ( argv )
137137
138138 // Require the site indexer and initialize it with options
139- app . searchhandler = searchhandler = searchFactory ( argv )
139+ app . searchhandler = searchhandler = searchFactory . default ( argv )
140140
141141 // Require the security adapter and initialize it with options.
142- app . securityhandler = securityhandler = require ( argv . security_type ) ( log , loga , argv )
142+ app . securityhandler = securityhandler = require ( argv . security_type ) . default ( log , loga , argv )
143143
144144 // If the site is owned, owner will contain the name of the owner
145145 let owner = ''
@@ -928,7 +928,7 @@ module.exports = exports = argv => {
928928 app . on ( 'running-serv' , server => {
929929 // ### Plugins ###
930930 // Should replace most WebSocketServers below.
931- const plugins = pluginsFactory ( argv )
931+ const plugins = pluginsFactory . default ( argv )
932932 plugins . startServers ( { argv, app } )
933933 // ### Sitemap ###
934934 // create sitemap at start-up
0 commit comments