-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.txt
49 lines (30 loc) · 1.67 KB
/
README.txt
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
This document specifies guideines to start stemcell-GO which is a basic server application.
The intent of this repository is to provide a basic framework to write GO server application which only requires to replace business logic.
The project spawns 2 microservices:
1. PostgreSQL - database for data storage
2. Hornet - web server for CRUD operations
Pre-requisites:
1. Internet connection to download dependencies.
To start the server-
1. on Ubuntu machine, run script "run-ubuntu.sh"
2. for other OSs, run below command from the project directory where docker-compose.yml is present:
docker-compose up -d
NOTE: On host machines with OSs other then Ubuntu, docker and docker-compose utility must be already installed on it.
To interact with the server-
1. get server host IP of the machine running the microservices:
ifconfig|less
2. The server listens on port 8080. One can send request using curl or Postman.
ex: curl -k http://localhost:8080/api/resource/
The server exposes 5 API endpoints:
1. POST /api/resource - Create a new resource
2. GET /api/resource/{id} - Get a specific resource by ID
3. PUT /api/resource/{id} - Update an existing resource by ID
4. DELETE /api/resource/{id} - Delete a resource by ID
5. GET /api/resource/ - List all resources
The payload request of API endpoint is a string which will be stored into DB alongwith an ID field that will be the primary key:
ex:
{
"payload": <string>
}
The ansible-playbook directory contains playbooks to deploy a running stemcell-GO server on a EC2 instance. Refer to its README.txt for more info.
The exposed endpoints can be tested via importing postman collection provided in test/postman-collections directory.