File tree Expand file tree Collapse file tree 1 file changed +45
-1
lines changed Expand file tree Collapse file tree 1 file changed +45
-1
lines changed Original file line number Diff line number Diff line change @@ -8,4 +8,48 @@ The audience of this API is twofold:
88
99*  as a backend for the [ native components] ( https://github.com/sdkman/sdkman-cli-native )  written in Rust
1010*  as admin API of the datastore, used directly or by build system plugins and
11-   the [ DISCO integration] ( https://github.com/sdkman/sdkman-disco-integration ) 
11+   the [ DISCO integration] ( https://github.com/sdkman/sdkman-disco-integration ) 
12+ 
13+ ## Running Locally  
14+ 
15+ 1 .  Start PostgreSQL database:
16+    ``` bash 
17+    docker run --restart=always \
18+        --name postgres \
19+        -p 5432:5432 \
20+        -e POSTGRES_USER=postgres \
21+        -e POSTGRES_PASSWORD=postgres \
22+        -e POSTGRES_DB=sdkman \
23+        -d postgres
24+    ``` 
25+ 
26+ 2 .  Run the service:
27+    ``` bash 
28+    ./gradlew run
29+    ``` 
30+ 
31+ The service will start on port 8080.
32+ 
33+ ## Running Tests  
34+ 
35+ ``` bash 
36+ ./gradlew test 
37+ ``` 
38+ 
39+ ## API Usage Examples  
40+ 
41+ ### POST a new version (requires authentication):  
42+ ``` bash 
43+ http POST localhost:8080/versions \
44+     candidate=java \
45+     version=21.0.2 \
46+     platform=LINUX_X64 \
47+     url=https://download.oracle.com/java/21/archive/jdk-21.0.1_linux-x64_bin.tar.gz \
48+     visible:=true \
49+     --auth testuser:password123
50+ ``` 
51+ 
52+ ### GET versions for a candidate:  
53+ ``` bash 
54+ http GET localhost:8080/versions/java
55+ ``` 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments