Skip to content

Commit

Permalink
Google info
Browse files Browse the repository at this point in the history
  • Loading branch information
rosera committed Jul 10, 2021
1 parent 05fe047 commit ff5e538
Show file tree
Hide file tree
Showing 11 changed files with 967 additions and 1 deletion.
9 changes: 9 additions & 0 deletions gcp/lab01/README.md
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/)
8 changes: 8 additions & 0 deletions gcp/lab02/README.md
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)


2 changes: 1 addition & 1 deletion gcp/lab05/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,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']
args: ['push', 'gcr.io/$PROJECT_ID/restapi:0.0.1']
```
11 changes: 11 additions & 0 deletions gcp/lab06/README.md
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)

6 changes: 6 additions & 0 deletions gcp/lab06/gc-products-api/Dockerfile
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" ]
22 changes: 22 additions & 0 deletions gcp/lab06/gc-products-api/app.json
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
}
}

5 changes: 5 additions & 0 deletions gcp/lab06/gc-products-api/cloudbuild.yaml
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']
14 changes: 14 additions & 0 deletions gcp/lab06/gc-products-api/data/products.json
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"}
]
}
18 changes: 18 additions & 0 deletions gcp/lab06/gc-products-api/index.js
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});
})
Loading

0 comments on commit ff5e538

Please sign in to comment.