Giter Site home page Giter Site logo

elm-server's People

Contributors

maxgurewitz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

rundis lemol

elm-server's Issues

Feature request: Option to rewrite paths to serve start-path

Firstly tx for a very handy npm lib.

Had a hard time coming up with a short description, so here's a bit of context:

  • I have a single page app using elm-transit-router
  • When navigating between pages it changes the browser-url according to how I set up routing

So a typical scenario in my sample app (https://github.com/rundis/albums):

  • elm-server Main.elm --output main.js --start-path index.html
  • I get an url like: http://localhost:3001
  • I navigate to an artist listing page and get a browser-url: http://localhost:3001/artists
  • I make a change in some elm file
  • elm-server recompiles as expected, but my browser does a get request to http://localhost:3001/artists
    which I suppose is fair play, but unfortunately that obviously results in a 404.

That sort of ruins the flow quite a bit. So it would be super awesome if there was some solution to handle this scenario. Maybe a glob-pattern to tell the server to serve (say index.html) for any url in the glob pattern ?

Can't find `elm-make`

Hi,

Here's what I get in the console:

events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: spawn /usr/local/lib/node_modules/elm-server/node_modules/elm/Elm-Platform/0.17.1/.cabal-sandbox/bin/elm-make ENOENT
    at exports._errnoException (util.js:860:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
    at onErrorNT (internal/child_process.js:344:16)
    at doNTCallback2 (node.js:450:9)
    at process._tickCallback (node.js:364:17)
    at Function.Module.runMain (module.js:459:11)
    at startup (node.js:136:18)
    at node.js:972:3

I have elm-make in $PATH:

$ which elm-make
/usr/local/bin/elm-make

There's also another one in

/usr/local/lib/node_modules/elm-server/node_modules/elm/binwrappers/elm-make

But the path elm-server is trying to run doesn't exist.

Currently Broken - Don't Use

Trying to run the buttons example from the current Elm repository (https://guide.elm-lang.org/architecture/user_input/buttons.html) yields the following. This repo is broken and seemingly hasn't been updated in a while. Don't use it.

patientplatypus:~/Documents/elmTree:08:21:19$elm-server ./Main.elm
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: spawn /Users/patientplatypus/.nvm/versions/node/v8.1.4/lib/node_modules/elm-server/node_modules/elm/Elm-Platform/0.17.1/.cabal-sandbox/bin/elm-make ENOENT
    at exports._errnoException (util.js:1022:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:189:19)
    at onErrorNT (internal/child_process.js:366:16)
    at _combinedTickCallback (internal/process/next_tick.js:102:11)
    at process._tickCallback (internal/process/next_tick.js:161:9)
    at Function.Module.runMain (module.js:607:11)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:575:3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.