Refactor API, RAW and WEB
ci/woodpecker/push/test_golang Pipeline was successful
Details
ci/woodpecker/push/test_golang Pipeline was successful
Details
parent
b19f86642b
commit
a54180d464
@ -1,38 +0,0 @@
|
||||
// Copyright (C) 2021-2023 Leonid Maslakov.
|
||||
|
||||
// This file is part of Lenpaste.
|
||||
|
||||
// Lenpaste is free software: you can redistribute it
|
||||
// and/or modify it under the terms of the
|
||||
// GNU Affero Public License as published by the
|
||||
// Free Software Foundation, either version 3 of the License,
|
||||
// or (at your option) any later version.
|
||||
|
||||
// Lenpaste is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
// or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Affero Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU Affero Public License along with Lenpaste.
|
||||
// If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package web
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// Pattern: /
|
||||
func (data *Data) MainHand(rw http.ResponseWriter, req *http.Request) {
|
||||
// Log request
|
||||
data.Log.HttpRequest(req)
|
||||
|
||||
// If main page
|
||||
if req.URL.Path == "/" {
|
||||
data.newPaste(rw, req)
|
||||
|
||||
// Else show paste
|
||||
} else {
|
||||
data.getPaste(rw, req)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue