Page Menu
Home
Musing Studio
Search
Configure Global Search
Log In
Files
F12725320
routes.go
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
691 B
Subscribers
None
routes.go
View Options
package
writefreely
import
(
"github.com/gorilla/mux"
"github.com/writeas/web-core/log"
"github.com/writeas/writefreely/config"
"strings"
)
func
initRoutes
(
handler
*
Handler
,
r
*
mux
.
Router
,
cfg
*
config
.
Config
,
db
*
datastore
)
{
isSingleUser
:=
!
cfg
.
App
.
MultiUser
// Write.as router
hostSubroute
:=
cfg
.
Server
.
Host
[
strings
.
Index
(
cfg
.
Server
.
Host
,
"://"
)
+
3
:]
if
isSingleUser
{
hostSubroute
=
"{domain}"
}
else
{
if
strings
.
HasPrefix
(
hostSubroute
,
"localhost"
)
{
hostSubroute
=
"localhost"
}
}
if
isSingleUser
{
log
.
Info
(
"Adding %s routes (single user)..."
,
hostSubroute
)
return
}
// Primary app routes
log
.
Info
(
"Adding %s routes (multi-user)..."
,
hostSubroute
)
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 20, 9:34 PM (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3548279
Attached To
rWF WriteFreely
Event Timeline
Log In to Comment