Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

Commit 0899a27

Browse files
committed
fix: server routes
1 parent dffba4a commit 0899a27

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

server/handler.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,15 @@ func (s *Server) handleCat(c *fiber.Ctx) error {
136136
return fiber.ErrBadRequest
137137
}
138138

139-
ok, err := s.idx.Exist(cid)
140-
if err != nil {
141-
zap.S().Errorf("idx get err: %s", err)
142-
return err
143-
}
144-
145-
if !ok {
146-
return fiber.ErrBadRequest
147-
}
139+
// ok, err := s.idx.Exist(cid)
140+
// if err != nil {
141+
// zap.S().Errorf("idx get err: %s", err)
142+
// return err
143+
// }
144+
145+
// if !ok {
146+
// return fiber.ErrBadRequest
147+
// }
148148

149149
path := filepath.Join(cid, c.Params("file"))
150150
src, err := s.ipc.CatStream(path)

server/server.go

+3
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,7 @@ func (s *Server) registerRoutes(app *fiber.App) {
9999
app.Get("/:cid/raw/:file", s.handleCat)
100100

101101
app.Static("/", "./dist")
102+
app.Get("/*", func(c *fiber.Ctx) error {
103+
return c.SendFile("./dist/index.html")
104+
})
102105
}

src/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function App() {
2525
<div tw='min-h-[80vh]'>
2626
<Sections />
2727
</div>
28-
<aside tw='mt-5 text-center'>
28+
<aside tw='my-5 text-center'>
2929
<span tw='italic'>©2021 Shoujo/IO, <a href="https://github.com/mayocream/pastebin-ipfs/issues">Feedback</a></span>
3030
</aside>
3131
</>

0 commit comments

Comments
 (0)