forked from OpenFunction/functions-framework-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRoutable.java
More file actions
31 lines (28 loc) · 901 Bytes
/
Routable.java
File metadata and controls
31 lines (28 loc) · 901 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package dev.openfunction.functions;
/**
* An object that can route the specified http request to the specified function.
*/
public abstract class Routable {
public static final String METHOD_DELETE = "DELETE";
public static final String METHOD_HEAD = "HEAD";
public static final String METHOD_GET = "GET";
public static final String METHOD_PATCH = "PATCH";
public static final String METHOD_POST = "POST";
public static final String METHOD_PUT = "PUT";
/**
* Get the supported http methods.
*
* @return The supported http methods.
*/
public String[] getMethods() {
return new String[]{METHOD_DELETE, METHOD_GET, METHOD_PATCH, METHOD_HEAD, METHOD_PUT, METHOD_POST};
};
/**
* Get the URI that will be routed.
*
* @return The URI that will be routed.
*/
public String getPath(){
return "/";
}
}