-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.js
38 lines (31 loc) · 893 Bytes
/
serverless.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const { Component } = require('@serverless/core');
class Website extends Component {
async default(inputs = { env: 'dev', name: 'my-site' }) {
const template = await this.load('@serverless/template', inputs.env);
const output = await template({
template: {
name: inputs.name,
admin: {
component: '@serverless/[email protected]',
inputs: {
code: {
src: 'dist',
root: './'
},
env: {},
region: `us-east-2`,
bucketName: `sls-${inputs.env}-domain-com`,
domain: `sls-${inputs.env}.domain.com`
}
}
}
});
return output;
}
async remove(inputs = { env: 'dev' }) {
const website = await this.load('@serverless/template', inputs.env);
await website.remove();
return {};
}
}
module.exports = Website;