GithubHelp home page GithubHelp logo

hoangtrucit / amazon-lambda-rest-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tomaszdrzazga/amazon-lambda-rest-api

0.0 1.0 0.0 14 KB

Spring boot application with Rest API as a proxy to Amazon RDS MySQL databse.

HTML 13.31% Java 86.69%

amazon-lambda-rest-api's Introduction

AWS Lambda JAVA8 REST API - serverless

Spring boot application with Rest API as a proxy to Amazon RDS MySQL databse.

1 Usage :

1.1. Clone project and configure database
spring.datasource.url=jdbc:mysql://url-to-database.rds.amazonaws.com:3306/batabase-name
spring.datasource.username=user
spring.datasource.password=password
1.2. Build and run project
mvn clean install
mvn spring-boot:run
1.3. Check localy
http://localhost:9000/status
expected response : "ALIVE"
1.4. Rest API methods for entity User
@Entity
public class User {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;
    private String name;
    private String email;

Rest API methods :

GET http://localhost:9000/users
POST http://localhost:9000/users?name=Tom&[email protected]
GET http://localhost:9000/users/{id}
DELETE http://localhost:9000/users/{id}
PUT http://localhost:9000/users/{id}?name=newname&[email protected]

GET http://localhost:9000/status

2. Deploy target/amazon-lambda-rest-api-0.0.1-SNAPSHOT.jar as AWS Lambda and expose as AWS Api Gateway

2.1 Youtube movie :

https://www.youtube.com/watch?v=LLEvZJn-8-E

Important : Lambda needs time to warm up. Click 2-3 times to "Test" button.

3. Publish API and test

3.1 Youtube movie :

https://www.youtube.com/watch?v=Q98vrCeU97A

3.2 Index.html - test page :

Project contains index.html page to test API. You need to change 'YOUR-API-URL' for Your new amazon url received after publish. (example value : 7g6esdddssal.execute-api.eu-central-1.amazonaws.com)

amazon-lambda-rest-api's People

Contributors

tomaszdrzazga avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.