index.js 483 字节
Newer Older
DCloud_JSON's avatar
DCloud_JSON 已提交
1
'use strict';
2 3 4 5 6 7 8 9
const success = {
	success: true
}
const fail = {
	success: false
}
const createPublishHtml = require('./createPublishHtml')

DCloud_JSON's avatar
DCloud_JSON 已提交
10 11 12 13 14 15 16 17
exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)

	let res = {};
	let params = event.data || event.params;

	switch (event.action) {
18 19
		case 'createPublishHtml':
			res = createPublishHtml(params.id)
DCloud_JSON's avatar
DCloud_JSON 已提交
20 21 22 23 24
			break;
	}

	//返回数据给客户端
	return res
25
};