File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,16 +55,6 @@ exports.helloContent = (req, res) => {
5555// [END functions_http_content]
5656
5757// [START functions_http_method]
58- function handleGET ( req , res ) {
59- // Do something with the GET request
60- res . status ( 200 ) . send ( 'Hello World!' ) ;
61- }
62-
63- function handlePUT ( req , res ) {
64- // Do something with the PUT request
65- res . status ( 403 ) . send ( 'Forbidden!' ) ;
66- }
67-
6858/**
6959 * Responds to a GET request with "Hello World!". Forbids a PUT request.
7060 *
@@ -77,10 +67,10 @@ function handlePUT(req, res) {
7767exports . helloHttp = ( req , res ) => {
7868 switch ( req . method ) {
7969 case 'GET' :
80- handleGET ( req , res ) ;
70+ res . status ( 200 ) . send ( 'Hello World!' ) ;
8171 break ;
8272 case 'PUT' :
83- handlePUT ( req , res ) ;
73+ res . status ( 403 ) . send ( 'Forbidden!' ) ;
8474 break ;
8575 default :
8676 res . status ( 405 ) . send ( { error : 'Something blew up!' } ) ;
You can’t perform that action at this time.
0 commit comments