Skip to content

Commit

Permalink
Suggestion around 'images' folder
Browse files Browse the repository at this point in the history
- Modify the names of two `image` directories under `\python` and `\go` into `images`
- Delete the unused 'image' directory under the parent directory
  • Loading branch information
e-yang08 committed May 14, 2022
1 parent a652ead commit 9d37348
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions go/app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

const (
ImgDir = "image"
ImgDir = "images"
)

type Response struct {
Expand Down Expand Up @@ -71,7 +71,7 @@ func main() {
// Routes
e.GET("/", root)
e.POST("/items", addItem)
e.GET("/image/:itemImg", getImg)
e.GET("/images/:itemImg", getImg)

// Start server
e.Logger.Fatal(e.Start(":9000"))
Expand Down
File renamed without changes.
File renamed without changes
3 changes: 0 additions & 3 deletions python/image/.gitignore

This file was deleted.

Binary file removed python/image/default.jpg
Binary file not shown.
File renamed without changes.
File renamed without changes
4 changes: 2 additions & 2 deletions python/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
app = FastAPI()
logger = logging.getLogger("uvicorn")
logger.level = logging.INFO
images = pathlib.Path(__file__).parent.resolve() / "image"
images = pathlib.Path(__file__).parent.resolve() / "images"
origins = [ os.environ.get('FRONT_URL', 'http://localhost:3000') ]
app.add_middleware(
CORSMiddleware,
Expand Down Expand Up @@ -39,4 +39,4 @@ async def get_image(items_image):
logger.debug(f"Image not found: {image}")
image = images / "default.jpg"

return FileResponse(image)
return FileResponse(image)

0 comments on commit 9d37348

Please sign in to comment.