Clean up url-shortener examples
Update favicon to moolumi icon
Remove unneeded dependencies in package.json
Change version in package.json so `npm install` doesn't complain
Add a few default settings to Pulumi.yaml for url-shortener-with-cache, for ease of use
MODIFY
url-shortener-with-cache/.gitignore
url-shortener-with-cache/.gitignore
/bin/
/node_modules/
/yarn.lock
+/package-lock.json

MODIFY
url-shortener-with-cache/Pulumi.yaml
url-shortener-with-cache/Pulumi.yaml
name: url-shortener
runtime: nodejs
description: URL shortener sample
+config:
+ url-shortener:config:redisPassword: SecretPassw0rd
+ aws:config:region: us-west-2
+ cloud-aws:config:ecsAutoCluster: true

MODIFY
url-shortener-with-cache/index.ts
url-shortener-with-cache/index.ts
@@ -9,7 +9,7 @@ let endpoint = new cloud.HttpEndpoint("urlshortener");
// Create a table `urls`, with `name` as primary key.
let urlTable = new cloud.Table("urls", "name");
-// Create a cache of frequently accessed urls
+// Create a cache of frequently accessed urls.
let urlCache = new cache.Cache("urlcache");
// Serve all files in the www directory to the root.

MODIFY
url-shortener-with-cache/package.json
url-shortener-with-cache/package.json
{
"name": "url-shortener",
- "version": "0.1",
+ "version": "1.0.0",
"main": "bin/index.js",
"typings": "bin/index.d.ts",
"scripts": {
"@pulumi/cloud": "*"
},
"dependencies": {
- "@types/node-fetch": "^1.6.7",
- "node-fetch": "^1.7.3",
"redis": "^2.8.0"
}
}

MODIFY
url-shortener-with-cache/www/favicon.png
url-shortener-with-cache/www/favicon.png
Binary files a/url-shortener-with-cache/www/favicon.png and b/url-shortener-with-cache/www/favicon.png differ

MODIFY
url-shortener-with-cache/www/index.html
url-shortener-with-cache/www/index.html
data.forEach(item =>
$("#urltable").append(
`<tr>
- <td><a href=\"/stage/url/${item.name}\">${item.name}</a></td>
+ <td><a target="_blank" href=\"/stage/url/${item.name}\">${item.name}</a></td>
<td>${item.url}</td>
</tr>`
)

MODIFY
url-shortener/.gitignore
url-shortener/.gitignore
/bin/
/node_modules/
/yarn.lock
+/package-lock.json

MODIFY
url-shortener/package.json
url-shortener/package.json
{
"name": "url-shortener",
- "version": "0.1",
+ "version": "1.0.0",
"main": "bin/index.js",
"typings": "bin/index.d.ts",
"scripts": {
},
"peerDependencies": {
"@pulumi/cloud": "*"
- },
- "dependencies": {
- "@types/node-fetch": "^1.6.7",
- "node-fetch": "^1.7.3",
- "redis": "^2.8.0"
}
}

MODIFY
url-shortener/www/favicon.png
url-shortener/www/favicon.png
Binary files a/url-shortener/www/favicon.png and b/url-shortener/www/favicon.png differ

MODIFY
url-shortener/www/index.html
url-shortener/www/index.html
data.forEach(item =>
$("#urltable").append(
`<tr>
- <td><a href=\"/stage/url/${item.name}\">${item.name}</a></td>
+ <td><a target="_blank" href=\"/stage/url/${item.name}\">${item.name}</a></td>
<td>${item.url}</td>
</tr>`
)

Clean up url-shortener examples

- Update favicon to moolumi icon
- Remove unneeded dependencies in package.json
- Change version in package.json so `npm install` doesn't complain
- Add a few default settings to Pulumi.yaml for url-shortener-with-cache, for ease of use