GithubHelp home page GithubHelp logo

ishitagupta1198 / getting-started-gcp-app-engine-cg Goto Github PK

View Code? Open in Web Editor NEW

This project forked from codingurukul/getting-started-gcp-app-engine-cg

0.0 0.0 0.0 16 KB

Deploying simple static web app on Google App Engine

HTML 100.00%

getting-started-gcp-app-engine-cg's Introduction

Deploy Static Web App in Google App Engine

You can use Google App Engine to host a static website. Static web pages can contain client-side technologies such as HTML, CSS, and JavaScript.

Before you begin

  1. Create a new GCP Console project
  2. Install and then initialize the Google Cloud SDK: Click Here

Creating a website to host on Google App Engine

Basic structure for the project

This guide uses the following structure for the project: .

  • app.yaml
  • www/
    • css/
    • js/
    • img/
    • index.html

Details

  1. app.yaml: Configure the settings of your App Engine application.
  2. www/: Directory to store all of your static files, such as HTML, CSS, images, and JavaScript.
  3. css/: Directory to store stylesheets.
  4. style.css: Basic stylesheet that formats the look and feel of your site.
  5. img/: Optional directory to store images.
  6. index.html: An HTML file that displays content for your website.
  7. js/: Optional directory to store JavaScript files.
  8. Other asset directories.

Creating the app.yaml file

The app.yaml file is a configuration file that tells App Engine how to map URLs to your static files. In the following steps, you will add handlers that will load www/index.html when someone visits your website, and all static files will be stored in and called from the www directory.

app.yaml file

runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /
  static_files: www/index.html
  upload: www/index.html

- url: /(.*)
  static_files: www/\1
  upload: www/(.*)

Creating the index.html file

Create an HTML file that will be served when someone navigates to the root page of your website. Store this file in your www directory.

index.html file

<html>
  <head>
    <title>Hello, world!</title>
    <link rel="stylesheet" type="text/css" href="/css/style.css">
  </head>
  <body>
    <h1>Hello, world!</h1>
    <p>
      This is a simple static HTML file that will be served from Google App
      Engine.
    </p>
  </body>
</html>

Deploying your application to App Engine

Use command in GCP SDK with the dir gcloud app deploy

View the Web Application

gcloud app browser

getting-started-gcp-app-engine-cg's People

Contributors

vrijraj avatar ishitagupta1198 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.