|
1 | 1 | # CODAP Plugin Starter Project |
2 | 2 |
|
3 | | -This is a bare-bones React project, created with the `--typescript` version of [Create React App](https://github.com/facebook/create-react-app), and left un-ejected. This is simply a trivial React view with the libraries for using the [CODAP Plugin API](https://github.com/concord-consortium/codap/wiki/CODAP-Data-Interactive-Plugin-API). |
| 3 | +This is a bare-bones React project. It contains a simple React view with the libraries for using the [CODAP Plugin API](https://github.com/concord-consortium/codap/wiki/CODAP-Data-Interactive-Plugin-API). |
4 | 4 |
|
5 | 5 | ## Development |
6 | 6 |
|
@@ -57,55 +57,22 @@ This is a bare-bones React project, created with the `--typescript` version of [ |
57 | 57 |
|
58 | 58 | ## Testing the plugin in CODAP |
59 | 59 |
|
60 | | -Currently there is no trivial way to load a plugin running on a local server with `http` into the online CODAP, which forces `https`. One simple solution is to download the latest `build_[...].zip` file from https://codap.concord.org/releases/zips/, extract it to a folder and run it locally. If CODAP is running on port 8080, and this project is running by default on 3000, you can go to |
| 60 | +There are two ways to test the plugin in CODAP: |
| 61 | +- running it locally on https and use the deployed CODAP |
| 62 | +- running it and CODAP locally on http |
61 | 63 |
|
62 | | -http://127.0.0.1:8080/static/dg/en/cert/index.html?di=http://localhost:3000 |
| 64 | +### HTTPS |
| 65 | +1. Start the plugin with `npm run start:secure`. You need to first setup a local http certificate if you haven't done so: https://github.com/concord-consortium/codap/blob/main/v3/README.md#run-using-https |
| 66 | +2. Run CODAP v2 or v3 with the `di` parameter: |
| 67 | + - v2: https://codap.concord.org/app/?di=https://localhost:8080/ |
| 68 | + - v3: https://codap3.concord.org/?di=https://localhost:8080/ |
63 | 69 |
|
64 | | -to see the plugin running in CODAP. |
| 70 | +### HTTP |
| 71 | +1. Start plugin webserver `npm start` (it will be on 8080 by default) |
| 72 | +2. Setup a local webserver running CODAP. |
| 73 | + - v2: Download the latest `build_[...].zip` file https://codap.concord.org/releases/zips/. Extract the zip to a folder and run it with a local webserver. For example `npx httpserver -p 8081` |
| 74 | + - v3: Checkout the v3 source, install the dependencies, and start the dev server: https://github.com/concord-consortium/codap/blob/main/v3/README.md#initial-steps. The dev server should automatically choose the next avaiable port which would normally be 8081 |
| 75 | +3. Open CODAP with the plugin embedded in it: http://localhost:8081/static/dg/en/cert/index.html?di=http://localhost:8080 |
65 | 76 |
|
66 | | -# Create React App Readme |
67 | 77 |
|
68 | | -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). |
69 | | -
|
70 | | -## Available Scripts |
71 | | -
|
72 | | -In the project directory, you can run: |
73 | | -
|
74 | | -### `npm start` |
75 | | -
|
76 | | -Runs the app in the development mode.<br> |
77 | | -Open [http://localhost:3000](http://localhost:3000) to view it in the browser. |
78 | | -
|
79 | | -The page will reload if you make edits.<br> |
80 | | -You will also see any lint errors in the console. |
81 | | -
|
82 | | -### `npm test` |
83 | | -
|
84 | | -Launches the test runner in the interactive watch mode.<br> |
85 | | -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. |
86 | | -
|
87 | | -### `npm run build` |
88 | | -
|
89 | | -Builds the app for production to the `build` folder.<br> |
90 | | -It correctly bundles React in production mode and optimizes the build for the best performance. |
91 | | -
|
92 | | -The build is minified and the filenames include the hashes.<br> |
93 | | -Your app is ready to be deployed! |
94 | | -
|
95 | | -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. |
96 | | -
|
97 | | -### `npm run eject` |
98 | | -
|
99 | | -**Note: this is a one-way operation. Once you `eject`, you can’t go back!** |
100 | | -
|
101 | | -If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. |
102 | | -
|
103 | | -Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. |
104 | | -
|
105 | | -You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. |
106 | | -
|
107 | | -## Learn More |
108 | | -
|
109 | | -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). |
110 | | -
|
111 | | -To learn React, check out the [React documentation](https://reactjs.org/). |
| 78 | +For further information on [CODAP Data Interactive Plugin API](https://github.com/concord-consortium/codap/wiki/CODAP-Data-Interactive-Plugin-API). |
0 commit comments