-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
967 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# A tour of Google Cloud | ||
|
||
To find information visit [Google Cloud](https://cloud.google.com/) | ||
|
||
- [x] [Google Cloud Free Program](https://cloud.google.com/free/docs/gcp-free-tier) | ||
- [x] [Quickstart](https://cloud.google.com/gcp/getting-started) | ||
- [x] [Architecture](https://cloud.google.com/architecture) | ||
- [x] [Certification](https://cloud.google.com/certification) | ||
- [x] [Blog](https://cloud.google.com/blog/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Cloud APIs | ||
|
||
Google Cloud enables you to interact with the cloud platform via an API. | ||
Cloud APIs use REST calls or client libraries. | ||
|
||
Learn more by visiting [Cloud APIs](https://cloud.google.com/apis) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Cloud Run | ||
|
||
## How to use Cloud Run | ||
|
||
- [x] [Cloud Run](https://cloud.google.com/run) | ||
- [x] [Quickstart](https://cloud.google.com/run/docs/quickstarts/prebuilt-deploy) | ||
|
||
|
||
## Deploy Example REST API | ||
[![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM node:12-slim | ||
WORKDIR /usr/src/app | ||
COPY package.json package*.json ./ | ||
RUN npm install --only=production | ||
COPY . . | ||
CMD [ "npm", "start" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "rest-api", | ||
"dir=": "flutter_workshop/gcp/lab06/gc-products-api", | ||
"env": { | ||
"BACKGROUND_COLOR": { | ||
"description": "specify a css color", | ||
"value": "#fefefe", | ||
"required": false | ||
}, | ||
"TITLE": { | ||
"description": "Flutter Workshop example REST API" | ||
} | ||
}, | ||
"options": { | ||
"allow-unauthenticated": true, | ||
"memory": "256Mi", | ||
"cpu": "1", | ||
"port": 8080, | ||
"http2": false | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
steps: | ||
- name: gcr.io/cloud-builders/docker | ||
args: ['build', '-t', 'gcr.io/$PROJECT_ID/restapi:0.0.1', '.'] | ||
- name: 'gcr.io/cloud-builders/docker' | ||
args: ['push', 'gcr.io/$PROJECT_ID/restap:0.0.1'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"products": [ | ||
{"title": "Compute"}, | ||
{"title": "Storage"}, | ||
{"title": "Databases"}, | ||
{"title": "Networking"}, | ||
{"title": "Operations"}, | ||
{"title": "Tools"}, | ||
{"title": "Big Data"}, | ||
{"title": "Artifical Intelligence"}, | ||
{"title": "Google Solutions"}, | ||
{"title": "Partner Solutions"} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const express = require('express'); | ||
const PORT = process.env.PORT || 8080; | ||
const app = express(); | ||
const products = require('./data/products'); | ||
|
||
app.use(express.json()); | ||
|
||
app.listen(PORT, () => { | ||
console.log(`Simple REST API listening on port ${PORT}`); | ||
}); | ||
|
||
app.get('/', async (req, res) => { | ||
return res.status(200).json({'Status':'OK', 'Payload': products}); | ||
}) | ||
|
||
app.post('/', async (req, res) => { | ||
return res.status(200).json({'Status':'OK', 'Payload': products}); | ||
}) |
Oops, something went wrong.