Created
June 29, 2021 06:35
-
-
Save flashvnn/40bbdb51993eb38555e56ed4ca851426 to your computer and use it in GitHub Desktop.
Totaljs Serverless
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
require('total4'); | |
const serverless = require('serverless-http'); | |
async function Server(req, res, options) { | |
F.console = NOOP; | |
return new Promise(function (resolve, reject) { | |
F.custom('prod', undefined, req, res, options, () => resolve(true)); | |
}) | |
} | |
const app = async function (req, res) { | |
await Server(req, res, { directory: __dirname }); | |
F.listener(req, res); | |
} | |
module.exports.handler = serverless(app); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment