@kirkelliott/zap 0.1.13 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.js +5 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -71,7 +71,7 @@ async function walkZap(dir, prefix = '') {
71
71
  }
72
72
  return results;
73
73
  }
74
- async function deployFile(b, filePath, key) {
74
+ async function deployFile(b, filePath, key, baseUrl) {
75
75
  const source = await (0, promises_1.readFile)(filePath, 'utf8');
76
76
  await s3.send(new client_s3_1.PutObjectCommand({ Bucket: b, Key: key, Body: source, ContentType: 'application/javascript' }));
77
77
  const name = key.replace(/\.zap$/, '');
@@ -86,7 +86,8 @@ async function deployFile(b, filePath, key) {
86
86
  console.log(`+ ${name} ↻ ${cronExpr}`);
87
87
  }
88
88
  else {
89
- console.log(`+ ${name}`);
89
+ const url = baseUrl ? ` → ${baseUrl.replace(/\/$/, '')}/${name}` : '';
90
+ console.log(`+ ${name}${url}`);
90
91
  }
91
92
  }
92
93
  const program = new commander_1.Command()
@@ -148,9 +149,10 @@ program
148
149
  .option('-b, --bucket <bucket>', 'S3 bucket (or set ZAP_BUCKET)')
149
150
  .action(async (opts) => {
150
151
  const b = bucket(opts);
152
+ const { url } = readConfig();
151
153
  const demoDir = (0, node_path_1.resolve)(__dirname, '..', 'demo');
152
154
  const files = await walkZap(demoDir, 'demo');
153
- await Promise.all(files.map(({ filePath, key }) => deployFile(b, filePath, key)));
155
+ await Promise.all(files.map(({ filePath, key }) => deployFile(b, filePath, key, url)));
154
156
  });
155
157
  program
156
158
  .command('debug')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kirkelliott/zap",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "Drop a .zap file in S3. It becomes an API endpoint.",
5
5
  "main": "dist/handler.js",
6
6
  "bin": {