Skip to content

Commit d10a7d4

Browse files
Ace Nassridandhlee
andauthored
feat(functions/slack): add GCF v2 decorators (GoogleCloudPlatform#7889)
* feat(functions/slack): add GCF v2 decorators * Fix lint * Fix copyright * Bots hate commas * Humans hate commas too * Fix copyright Co-authored-by: Dan Lee <71398022+dandhlee@users.noreply.github.com> Co-authored-by: Dan Lee <71398022+dandhlee@users.noreply.github.com>
1 parent cc69155 commit d10a7d4

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

functions/slack/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018, Google, LLC.
1+
# Copyright 2018 Google LLC.
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at
@@ -15,6 +15,7 @@
1515
import os
1616

1717
from flask import jsonify
18+
import functions_framework
1819
import googleapiclient.discovery
1920
from slack.signature import SignatureVerifier
2021

@@ -89,6 +90,7 @@ def make_search_request(query):
8990

9091

9192
# [START functions_slack_search]
93+
@functions_framework.http
9294
def kg_search(request):
9395
if request.method != 'POST':
9496
return 'Only POST requests are accepted', 405

functions/slack/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
google-api-python-client==2.41.0
22
flask==2.1.0
3+
functions-framework==3.0.0
34
slackclient==2.9.4

0 commit comments

Comments
 (0)