codepan icon indicating copy to clipboard operation
codepan copied to clipboard

How to install and run codpan

Open rtwk opened this issue 7 years ago • 16 comments

Coned it. Now how to instal and run it.

rtwk avatar Sep 18 '17 05:09 rtwk

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

egoist avatar Sep 18 '17 08:09 egoist

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

rtwk avatar Sep 18 '17 08:09 rtwk

Have you run yarn to install deps?

egoist avatar Sep 18 '17 08:09 egoist

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

rtwk avatar Sep 18 '17 09:09 rtwk

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

rtwk avatar Sep 18 '17 09:09 rtwk

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

egoist avatar Sep 18 '17 09:09 egoist

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

srayy avatar Sep 18 '17 09:09 srayy

want to many urls like jsbin available

what do you mean?

egoist avatar Sep 18 '17 09:09 egoist

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 avatar Sep 18 '17 10:09 srayy

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.

srayy avatar Sep 18 '17 10:09 srayy

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

egoist avatar Sep 18 '17 10:09 egoist

Yes. Almost. Let me try.

rtwk avatar Sep 18 '17 10:09 rtwk

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.

rtwk avatar Sep 18 '17 10:09 rtwk

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

egoist avatar Sep 18 '17 10:09 egoist

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?

rtwk avatar Sep 18 '17 10:09 rtwk

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?

llh1187 avatar Dec 14 '19 14:12 llh1187