optimizations
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"monkey"
|
||||
"net/http"
|
||||
|
||||
@@ -12,6 +14,9 @@ func (s *Server) runHandler() router.Handle {
|
||||
opts := &monkey.Options{
|
||||
Stdout: w,
|
||||
Stderr: w,
|
||||
Exit: func(status int) {
|
||||
io.WriteString(w, fmt.Sprintf("<p><i>Program exited with %d.</i></p>", status))
|
||||
},
|
||||
}
|
||||
|
||||
err := monkey.ExecString(r.FormValue("code"), opts)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<body>
|
||||
<div class="layout">
|
||||
<div class="top">
|
||||
<b><a href="https://git.unflavoredmeson.com/unflavoredmeson/monkey-lango"
|
||||
<b><a href="https://gitea.unflavoredmeson.com/unflavoredmeson/monkey-lango"
|
||||
style="color: #FFF; text-decoration: none;">Monkey</a></b>
|
||||
<span>⌘/Ctrl + ENTER to Run. ⌘/Ctrl + SPACE to Format.</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user