Last active
October 31, 2018 04:35
-
-
Save onema/fbcfd0bfead18542d0ec5630a71a2402 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.amazonaws.serverless.proxy.model.{AwsProxyRequest, AwsProxyResponse} | |
import com.amazonaws.services.lambda.runtime.Context | |
import io.onema.userverless.configuration.lambda.NoopLambdaConfiguration | |
import io.onema.userverless.function.ApiGatewayHandler | |
import io.onema.userverless.function.ApiGatewayHandler.Cors | |
import org.apache.http.HttpStatus | |
class ApiGatewayFunction | |
extends ApiGatewayHandler | |
with Cors | |
with NoopLambdaConfiguration { | |
//--- Methods --- | |
override protected def corsConfiguration(origin: Option[String]) = new EnvCorsConfiguration(origin) | |
def execute(request: AwsProxyRequest, context: Context): AwsProxyResponse = { | |
cors(request) { | |
new AwsProxyResponse(HttpStatus.SC_OK) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment