76 lines
1.5 KiB
Markdown
76 lines
1.5 KiB
Markdown
## Setup the project
|
|
|
|
1. Mulai edit ```.env``` (silakan copy dari ```.env.template```), kemudian edit paramter sesuai environment masing - masing.
|
|
```bash
|
|
cp env.template .env
|
|
```
|
|
example:
|
|
```
|
|
PUBLIC_HOST=http://localhost
|
|
PORT=8080
|
|
|
|
# Database
|
|
DB_USER=admin
|
|
DB_PASSWORD=Sasone!102938
|
|
DB_HOST=127.0.0.1
|
|
DB_PORT=4407
|
|
DB_NAME=westone
|
|
|
|
JWT_SECRET=--one_api-secret-2019-04-01
|
|
SESSION_KEY=Azw1Ds31sW1KP94ffaX2ykHg16SzxL0f2jh21Gh
|
|
GOOGLE_CLIENT_ID=
|
|
GOOGLE_CLIENT_SECRET=
|
|
```
|
|
|
|
2. update mod dependency:
|
|
```bash
|
|
go mod tidy
|
|
```
|
|
3. shh ke server dengan PuTTy
|
|
|
|
4. Run:
|
|
```bash
|
|
go run ./cmd/main.go
|
|
```
|
|
|
|
5. install ekstensi REST Client untuk menjalankan http api, coba run api login westone dari file ```auth.http```
|
|
6. buat folder ```.vscode``` dan file ```settings.json``` dan buat parameter token dari hasil login.
|
|
```
|
|
{
|
|
"rest-client.environmentVariables": {
|
|
"$shared": {
|
|
"token": "Bearer "
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
|
|
## Running the project
|
|
|
|
To run the project, you can use the following command:
|
|
|
|
```bash
|
|
go run ./cmd/main.go
|
|
```
|
|
|
|
## WRK test performance
|
|
|
|
1. ssh ke devone & masuk ke directory
|
|
```
|
|
~/perf-test/devcpone
|
|
```
|
|
2. upload script lua
|
|
3. run wrk
|
|
|
|
Format command:
|
|
wrk -t<number thread> -c<number connection> -d<number time in second>s -s <script name> <host name>
|
|
example:
|
|
|
|
```bash
|
|
wrk -t5 -c100 -d30s -s westone-search-patient.lua http://devcpone.aplikasi.web.id:9090
|
|
```
|
|
|
|
## Response API & Error Log Name
|
|
|
|
- [Link DOC Response Api](https://docs.google.com/document/d/1PCEkEMC7ucuKHFPE1xVyPKhVWaQTgX2iC2z8vw-gJe0/edit#heading=h.hhevn0icya3z) |