Setup the project
- Mulai edit
.env(silakan copy dari.env.template), kemudian edit paramter sesuai environment masing - masing.
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=
- update mod dependency:
go mod tidy
-
shh ke server dengan PuTTy
-
Run:
go run ./cmd/main.go
- install ekstensi REST Client untuk menjalankan http api, coba run api login westone dari file
auth.http - buat folder
.vscodedan filesettings.jsondan 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:
go run ./cmd/main.go
WRK test performance
- ssh ke devone & masuk ke directory
~/perf-test/devcpone
- upload script lua
- run wrk
Format command: wrk -t -c -ds -s <script name> example:
wrk -t5 -c100 -d30s -s westone-search-patient.lua http://devcpone.aplikasi.web.id:9090
Response API & Error Log Name
Description
Languages
Go
99.3%
Dockerfile
0.4%
Makefile
0.3%