egoist / codepan

Like codepen and jsbin but works offline.
https://codepan.egoist.sh
MIT License
1.19k stars 179 forks source link

How to install and run codpan #31

Open rtwk opened 7 years ago

rtwk commented 7 years ago

Coned it. Now how to instal and run it.

egoist commented 7 years ago

See https://github.com/egoist/codepan#development, run yarn to install deps.

Basically you can run yarn dev or npm run dev to run it in a dev server.

If you want a production build, run yarn build and it will be available in ./dist

rtwk commented 7 years ago

sh: 1: poi: not found when I run npm run dev

egoist commented 7 years ago

Have you run yarn to install deps?

rtwk commented 7 years ago

I installed yarn, run yarn build successfully. Got a dist folder. Now how to run it?

rtwk commented 7 years ago

I successfully run it on dev using yarn dev. How to run it on production server?

egoist commented 7 years ago

it's a static website so you can run it locally with serve, eg: serve dist --single (single page app mode)

srayy commented 7 years ago

OK. What we want is, want to many urls like jsbin available .How to do that?

egoist commented 7 years ago

want to many urls like jsbin available

what do you mean?

srayy commented 7 years ago

Actually we want to install in a site and embed many html/css/js examples in various pages. for example we have created an example https://codepan.net/gist/0ffcc5fa021aa45b87c0792d8362b5b5 Now we want to embed the above in various pages of our site and the url will be https://example.com/html-css-js/0ffcc5fa021aa45b87c0792d8362b5b5 Thanks for your response.

srayy commented 7 years ago

I just define more clearly after creating the above url i.e. https://example.com/html-css-js/0ffcc5fa021aa45b87c0792d8362b5b5 will be embed in https://example.com/js-examples page or any other pages under https://example.com.

egoist commented 7 years ago

I think you mean this https://github.com/egoist/codepan/issues/11

rtwk commented 7 years ago

Yes. Almost. Let me try.

rtwk commented 7 years ago

Well, for running it on production, I want to run it like 'forever somefile' so that it runs in the background and I can use this to render multiple urls, each presenting one code snippet. Is that possible. serve does not serve my purpose.

egoist commented 7 years ago

this is just an SPA, so I think it would be tricky even if it's possible.

rtwk commented 7 years ago

So, unlike jsbin I can not run the app in the background and then create multiple instances (urls) each presenting one url fetched from Github you say?

llh1187 commented 4 years ago

it's a static website so you can run it locally with serve, eg: serve dist --single (single page app mode) I want to use node.js to run the ./dist folder. Could you please tell me how can I do this?