Last active
September 23, 2017 20:14
-
-
Save enjikaka/8134935eea99c3e22b65c884542beb47 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use latest'; | |
import express from 'express'; | |
import compression from 'compression'; | |
const app = express(); | |
if (process.env.NODE_ENV === 'production') { | |
app.use(compression()); | |
} | |
app.get('*', (req, res) => { | |
res.send('Hello world'); | |
}); | |
export default app; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use latest'; | |
import WT from 'webtask-tools'; | |
import app from './app.mjs'; | |
// export default doesn't work, import above works though | |
module.exports = WT.fromExpress(app); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "bundle-mjs-test", | |
"version": "1.0.0", | |
"description": "mjs bundle webtask test", | |
"main": "bundle-mjs-test.mjs", | |
"scripts": { | |
"deploy": "wt create bundle-mjs-test.mjs --bundle --prod" | |
}, | |
"license": "ISC", | |
"dependencies": { | |
"compression": "^1.7.0", | |
"express": "^4.15.4", | |
"webtask-tools": "^3.2.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment