mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-07-22 20:26:50 +00:00
build
config
img
qortal-ui-core
assets
config
emoji
exports
font
language
memory-pow
public
server
routes
ServerFactory.js
server.js
sound
src
tooling
.eslintignore
.eslintrc.json
package.json
ui-core.js
qortal-ui-crypto
qortal-ui-plugins
scripts
snap
.editorconfig
.gitattributes
.gitignore
.travis.yml
CONTRIBUTING.md
LICENSE
README.md
build-setup.js
build.bat
build.js
build.sh
electron-builder.yml
electron.js
install-dependencies.sh
package.json
push-updates-with-travis-build.sh
run_server.bat
server.js
set-up-snap.sh
update-package-json.js
watch-inline.js
watch.js
25 lines
792 B
JavaScript
25 lines
792 B
JavaScript
const ServerFactory = require('./ServerFactory.js')
|
|
|
|
const createPrimaryRoutes = require('./routes/createPrimaryRoutes.js')
|
|
|
|
const createServer = (config, plugins) => {
|
|
this.start = async function () {
|
|
const primaryServer = new ServerFactory(createPrimaryRoutes(config, plugins), config.user.server.primary.host, config.user.server.primary.port, config.user.tls.enabled ? config.user.tls.options : void 0)
|
|
primaryServer.startServer()
|
|
.then(server => {
|
|
console.log(`Qortal UI Server started at ${server.info.uri} and listening on ${server.info.address}`)
|
|
})
|
|
.catch(e => {
|
|
console.error(e)
|
|
})
|
|
}
|
|
return this
|
|
}
|
|
|
|
|
|
const serverExports = {
|
|
createServer
|
|
}
|
|
|
|
module.exports = serverExports
|