1515'use strict' ;
1616
1717// [START gae_update_web_server_app]
18- // [START app]
19- // [START gae_update_app]
2018const express = require ( 'express' ) ;
2119const path = require ( 'path' ) ;
2220
@@ -31,15 +29,12 @@ app.get('/', (req, res) => {
3129 res . send ( 'Hello from App Engine!' ) ;
3230} ) ;
3331
34- // [START add_display_form]
3532// [START gae_add_display_form]
3633app . get ( '/submit' , ( req , res ) => {
3734 res . sendFile ( path . join ( __dirname , '/views/form.html' ) ) ;
3835} ) ;
3936// [END gae_add_display_form]
40- // [END add_display_form]
4137
42- // [START add_post_handler]
4338// [START gae_add_post_handler]
4439app . post ( '/submit' , ( req , res ) => {
4540 console . log ( {
@@ -49,15 +44,12 @@ app.post('/submit', (req, res) => {
4944 res . send ( 'Thanks for your message!' ) ;
5045} ) ;
5146// [END gae_add_post_handler]
52- // [END add_post_handler]
5347
5448// Listen to the App Engine-specified port, or 8080 otherwise
5549const PORT = parseInt ( process . env . PORT ) || 8080 ;
5650app . listen ( PORT , ( ) => {
5751 console . log ( `Server listening on port ${ PORT } ...` ) ;
5852} ) ;
59- // [END gae_update_app]
60- // [END app]
6153// [END gae_update_web_server_app]
6254
6355module . exports = app ;
0 commit comments