Skip to content

Commit 0319c3f

Browse files
committed
Add base scripts
1 parent 01ecc25 commit 0319c3f

File tree

6 files changed

+3031
-0
lines changed

6 files changed

+3031
-0
lines changed

.gitignore

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
2+
# Created by https://www.gitignore.io/api/node,firebase
3+
# Edit at https://www.gitignore.io/?templates=node,firebase
4+
5+
### Firebase ###
6+
.idea
7+
**/node_modules/*
8+
**/.firebaserc
9+
10+
### Firebase Patch ###
11+
.runtimeconfig.json
12+
.firebase/
13+
14+
### Node ###
15+
# Logs
16+
logs
17+
*.log
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*
21+
22+
# Runtime data
23+
pids
24+
*.pid
25+
*.seed
26+
*.pid.lock
27+
28+
# Directory for instrumented libs generated by jscoverage/JSCover
29+
lib-cov
30+
31+
# Coverage directory used by tools like istanbul
32+
coverage
33+
34+
# nyc test coverage
35+
.nyc_output
36+
37+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
38+
.grunt
39+
40+
# Bower dependency directory (https://bower.io/)
41+
bower_components
42+
43+
# node-waf configuration
44+
.lock-wscript
45+
46+
# Compiled binary addons (https://nodejs.org/api/addons.html)
47+
build/Release
48+
49+
# Dependency directories
50+
node_modules/
51+
jspm_packages/
52+
53+
# TypeScript v1 declaration files
54+
typings/
55+
56+
# Optional npm cache directory
57+
.npm
58+
59+
# Optional eslint cache
60+
.eslintcache
61+
62+
# Optional REPL history
63+
.node_repl_history
64+
65+
# Output of 'npm pack'
66+
*.tgz
67+
68+
# Yarn Integrity file
69+
.yarn-integrity
70+
71+
# dotenv environment variables file
72+
.env
73+
.env.test
74+
75+
# parcel-bundler cache (https://parceljs.org/)
76+
.cache
77+
78+
# next.js build output
79+
.next
80+
81+
# nuxt.js build output
82+
.nuxt
83+
84+
# vuepress build output
85+
.vuepress/dist
86+
87+
# Serverless directories
88+
.serverless/
89+
90+
# FuseBox cache
91+
.fusebox/
92+
93+
# DynamoDB Local files
94+
.dynamodb/
95+
96+
# End of https://www.gitignore.io/api/node,firebase

firebase.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"hosting": {
3+
"public": "public",
4+
"rewrites": [ {
5+
"source": "**", "function": "app"
6+
} ]
7+
}
8+
}

functions/index.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
'use strict';
2+
3+
const functions = require('firebase-functions');
4+
const express = require('express');
5+
const app = express();
6+
7+
const cors = require('cors')({origin: true});
8+
app.use(cors);
9+
10+
app.get('/', (req, res) => {
11+
res.json({ status: 'OK' });
12+
});
13+
14+
app.get('/:package', (req, res) => {
15+
res.json( req.params );
16+
});
17+
18+
exports.app = functions.https.onRequest(app);

functions/package.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "installer.to",
3+
"description": "A simple repo of installer scripts",
4+
"dependencies": {
5+
"cors": "^2.8.5",
6+
"express": "^4.16.4",
7+
"firebase-admin": "~6.5.1",
8+
"firebase-functions": "^2.1.0"
9+
},
10+
"devDependencies": {
11+
"eslint": "^4.13.1",
12+
"eslint-plugin-promise": "^3.6.0"
13+
},
14+
"scripts": {
15+
"lint": "./node_modules/.bin/eslint --max-warnings=0 .",
16+
"serve": "firebase serve --only functions",
17+
"shell": "firebase experimental:functions:shell",
18+
"start": "npm run shell",
19+
"deploy": "firebase deploy --only functions",
20+
"logs": "firebase functions:log"
21+
},
22+
"engines": {
23+
"node": "8"
24+
}
25+
}

0 commit comments

Comments
 (0)