Skip to content

Commit 549d3c2

Browse files
committed
update code firebase scripts
1 parent 25351ba commit 549d3c2

File tree

11 files changed

+29
-170
lines changed

11 files changed

+29
-170
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ performance/temp*.html
1010
*.swp
1111
angular.js.tmproj
1212
/node_modules/
13+
/scripts/code.angularjs.org-firebase/functions/node_modules/
1314
bower_components/
1415
angular.xcodeproj
1516
.idea
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"projects": {
3+
"default": "code-angularjs-org-338b8"
4+
}
5+
}

scripts/firebase/firebase.json renamed to scripts/code.angularjs.org-firebase/firebase.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"redirects": [ {
55
"source" : "/:version/docs",
66
"destination" : "/:version/docs/index.html",
7-
"type" : 302
7+
"type" : 301
88
}],
99
"rewrites": [
1010
{

scripts/firebase/functions/index.js renamed to scripts/code.angularjs.org-firebase/functions/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const functions = require('firebase-functions');
44
const gcs = require('@google-cloud/storage')();
55
const path = require('path');
66

7+
const gcsBucket = 'code-angularjs-org-338b8.appspot.com';
78
const LOCAL_TMP_FOLDER = '/tmp/';
89

910
function sendStoredFile(request, response) {
@@ -26,10 +27,9 @@ function sendStoredFile(request, response) {
2627

2728
downloadPath = path.join.apply(null, filePathSegments);
2829

29-
const bucket = gcs.bucket('ng-i-1121e.appspot.com');
30+
const bucket = gcs.bucket(gcsBucket);
3031

3132
downloadAndSend().catch(error => {
32-
3333
if (isDocsPath && error.code === 404) {
3434
fileName = 'index.html';
3535
filePathSegments = [version, 'docs', fileName];
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "functions-firebase-code.angularjs.org",
3+
"description": "Cloud Functions to serve files from gcs to code.angularjs.org",
4+
"dependencies": {
5+
"@google-cloud/storage": "^1.1.1",
6+
"firebase-admin": "^4.2.1",
7+
"firebase-functions": "^0.5.9"
8+
},
9+
"private": true
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>AngularJS</title>
7+
</head>
8+
<body>
9+
</body>
10+
</html>

scripts/firebase/.firebaserc

Lines changed: 0 additions & 5 deletions
This file was deleted.

scripts/firebase/functions/package.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

scripts/firebase/public/404.html

Lines changed: 0 additions & 33 deletions
This file was deleted.

scripts/firebase/public/index.html

Lines changed: 0 additions & 117 deletions
This file was deleted.

0 commit comments

Comments
 (0)