
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
elm-http-server
Advanced tools
A puny module for putting together HTTP-servers using Elm
Elm (along with the Elm architecture) is designed for browser-applications; This project in experimental attempt to embed the architecture inside a small Node.js Http-server program. Taking the unreasonable performance implications aside, it is fun to experience Elm as a shared language between client and server with all of it's nice properties for continuous improvement and modification. Enjoy! :)
The module is distributed through NPM:
npm install -S elm-http-server
Go to elm-package.json and expose the internal Elm-code from the module:
{ ...
"source-directories": [
...
"node_modules/elm-http-server/source"
],
...
}
Examples of usage can be found in the examples sub-directory.
elm-lang/http to run on the serverPlatform.program into Http.createServer in Node.JSin Node.js, assuming an Elm module named Main compiled to main.elm.js in the same directory, the API can be used as such:
var Ehs = require("elm-http-server")
var Http = require("http")
var App = require("./main.elm.js")
var PORT = 3000
var ID_GEN_SIZE = 420
var onRequest = Ehs.createRequestListener(App.Main.worker(), ID_GEN_SIZE)
var onStart = function () {
console.log("server started at http://localhost:" + PORT)
}
Http.createServer()
.on("request", onRequest)
.listen(PORT, onStart)
Importing elm-http-server automatically exposes XmlHttpRequest globally to enable usage of elm-lang/http in the Elm-modules on the server.
There is a couple of tiny modules for Elm, written to facilitate some basic server-logic.
type alias Request =
{ id : Id
, method : Method
, headers : Dict String String
, url : String
, body : Maybe String
}
type Method
= Get
| Put
| Post
| Delete
| Other String
listen : (Result String Request -> msg) -> Sub msg
html : Request.Id -> Status -> Server.Html.Document -> Response
text : Request.Id -> Status -> String -> Response
json : Request.Id -> Status -> Json.Encode.Value -> Response
empty : Request.Id -> Status -> Response
send : Response -> Cmd msg
type alias Header = ( String, String )
contentType : String -> Header
textContent : Header
htmlContent : Header
jsonContent : Header
type alias Status =
{ code : Int
, message : String
}
ok : Status
badRequest : Status
unauthorized : Status
notFound : Status
internalError : Status
document : String -> String -> Document
toString : Document -> String
FAQs
A puny module for putting together HTTP-servers using Elm
We found that elm-http-server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.