Comments (10)
Running try-purescript without a local backend
- Switch to the
gh-pages
branch - Use an http server to serve try-purescript (example:
python -m SimpleHTTPServer
orhttp-server -p 3000
) - Open your browser at http://localhost:8000 (or whichever port you used to serve) and you should see the try-purescript app
Running try-purescript with a local backend
Use the Haskell Stack build tool to build the backend:
- Clone the repo
- Run
stack build
(you might also need--install ghc
)
Install the core try-purescript packages:
(cd staging/core && psc-package update)
You might need to change the version in psc-pacakge.json
to the current compiler version installed on your machine (for example: "set": "psc-0.10.5"
)
After that you can run the server with:
stack exec trypurescript -- 3333 staging/core/.psc-package/psc-0.10.4/*/*/src/**/*.purs staging/core/src/TryPureScript.purs
You will also need to change the endpoint for core to point to your local backend:
- Switch again to
gh-pages
- Change this line to:
endpoint: "http://localhost:3333",
or similar
Actually, it will be easier to just clone the repo twice and keep one branch on master
for the backend and one branch on gh-pages
for the frontend.
Hope this helps.
from trypurescript.
Thanks for the tip and for the help, really appreciated @soupi :)
from trypurescript.
That's great! So I don't really need a server, I could host the static files on S3 or the likes and go from there.
Thank you so much for this @soupi, is it already written somewhere or what about adding it to the README?
from trypurescript.
What is your use case? we might be able to help more if we knew what you are trying to do :)
I can PR this if @paf31 wants it.
from trypurescript.
Ah yes sure! So I'm at Recurse Center (https://www.recurse.com/), me and a fellow recurser with Haskell experience are trying to come up with an online interactive website that could teach fundamental principles of functional programming in a typed language, for newbies like myself :D
So the idea is to have some theory explaining a subject, a few exercises followed by an input in which they could evaluate their answers, we would use the local version of try.purescript.org to evaluate the answers. That's one of the goals of our batch here, we are evaluating different solutions and one of those is PureScript.
from trypurescript.
Good luck! If you have further questions on PureScript specifically you might want to ask in IRC/Slack/Reddit/Mailing list where it'll get better exposure.
Also, you might also want to check Code World as well as you might have similar goals :)
from trypurescript.
@soupi I forgot about to ask (and sorry if this is not the best place), if it's ok to make calls to try.purescript.org to get back results in our project, which is all about learning functional programming using PureScript.
We don't expect to hammer it at all, both because we won't be showing the project a lot in the beginning and both because we call the endpoint on a specific key combination, not on onchange.
Please let me know your thoughts, and thanks again for your efforts on PureScript!
from trypurescript.
Best to ask @paf31 this kind of question :)
from trypurescript.
@lazywithclass Go for it :) Please let me know if you expect the usage to increase a lot, but for moderate use, that's what it's there for.
from trypurescript.
@paf31 that's great thanks! Yes, I will definitely come back if our project grows in terms of usage.
from trypurescript.
Related Issues (20)
- Migrate to GH Actions
- Deploy latest version? HOT 1
- Usage of React.Basic.Hooks is broken HOT 2
- Loading continues even after loading screen disappears HOT 2
- Proposal: Load foreign code with ES Module Shims and import maps HOT 5
- Proposal: Introduce `esbuild` for Try PureScript
- Uncaught Error: FFI dependency not provided: url HOT 3
- Type search "/search" endpoint not working
- Update to 0.15.0 compiler HOT 1
- Try PureScript is broken HOT 1
- How to deal with warnings in examples? HOT 2
- Uncaught ReferenceError: main is not defined HOT 3
- NPM dependency shims no longer work on Firefox 102.1? HOT 4
- Missing Effect import in examples
- User-inputted module's `main` call called twice HOT 7
- Proposal: Add the es-optimizer as an option for ShowJS HOT 1
- Publish as a library HOT 1
- The fallback github url has additional "/" in path HOT 4
- Code editor is difficult to use in iOS Safari
- Add options for bare-bones use
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trypurescript.