Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
Configure and demo API
Browse files Browse the repository at this point in the history
  • Loading branch information
hardingadonis committed Jan 18, 2024
1 parent b676977 commit 51d46d8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/main/java/io/hardingadonis/saledock/api/v1/DemoAPI.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package io.hardingadonis.saledock.api.v1;

import io.hardingadonis.saledock.model.*;
import io.hardingadonis.saledock.utils.*;
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.*;

@Path("v1/demo")
public class DemoAPI {

@GET
@Produces(MediaType.APPLICATION_JSON)
public Product getProduct() {
return Singleton.productDAO.getByID(1).get();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.hardingadonis.saledock.config;

import jakarta.ws.rs.*;
import org.glassfish.jersey.server.*;

@ApplicationPath("api")
public class SaleDockApplication extends ResourceConfig {

public SaleDockApplication() {
packages("io.hardingadonis.saledock.api");
}
}

0 comments on commit 51d46d8

Please sign in to comment.