Skip to content

Commit

Permalink
exporting createApp function in app.js
Browse files Browse the repository at this point in the history
  • Loading branch information
gracepark committed Jun 18, 2021
1 parent 9401a8f commit 67b3294
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
11 changes: 8 additions & 3 deletions lib/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
const express = require('express')
const middleware = require('../middleware/index.js')

const app = express()
require('../middleware')(app)
module.exports = app
function createApp () {
const app = express()
middleware(app)
return app
}

module.exports = createApp
7 changes: 5 additions & 2 deletions lib/frontmatter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
const parse = require('./read-frontmatter')
const semverValidRange = require('semver').validRange
const layoutNames = Object.keys(require('./layouts')).concat([false])
const semver = require('semver')
const layouts = require('./layouts')

const semverValidRange = semver.validRange
const layoutNames = Object.keys(layouts).concat([false])
const semverRange = {
type: 'string',
conform: semverValidRange,
Expand Down
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async function checkPortAvailability () {
}

async function startServer () {
const app = libApp
const app = libApp()
const warmServer = libWarmServer

// If in a deployed environment...
Expand Down

0 comments on commit 67b3294

Please sign in to comment.