mm-wang / WebApplicationWorkshop

Web application workshop, built for AEC Tech 2019: Seattle
MIT License
19 stars 11 forks source link

Can not run the webapplication #3

Open 1div0error opened 2 years ago

1div0error commented 2 years ago

Hi,

if I try to run your application, following the instructions, I get this erros:

npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated

changed 348 packages, and audited 349 packages in 16s

7 packages are looking for funding
  run `npm fund` for details

8 vulnerabilities (3 low, 5 moderate)

Do you have any idea why I can not run your app? Thank you and best regards

mm-wang commented 2 years ago

Hello! Those are typical warnings from node, but I don't know that they should affect the application running. What steps have you tried?

1div0error commented 2 years ago

Hello mm-wang, thank you for your help! What I did:

  1. npm i gulp -g
  2. gulp in the main direcetory, the response is:
[23:44:33] Using gulpfile ~\Desktop\WebApplicationWorkshop-master\gulpfile.js
[23:44:33] Starting 'default'...
[23:44:33] Starting 'prepSass'...
[23:44:33] Starting 'lintServerJs'...
[23:44:33] Finished 'prepSass' after 398 ms
[23:44:33] Finished 'lintServerJs' after 543 ms
[23:44:33] Starting 'lintBrowserJs'...
[23:44:33] Finished 'lintBrowserJs' after 271 ms
[23:44:33] Starting 'prepJsBrowserSrc'...
[23:44:33] Finished 'prepJsBrowserSrc' after 32 ms
[23:44:33] Starting 'jsRollup'...
[23:44:36] Finished 'jsRollup' after 2.08 s
[23:44:36] Starting 'watchBrowserJs'...
[23:44:36] Starting 'watchSass'...
[23:44:36] Starting 'watchServerJs'...
  1. npm start
  2. http://localhost:1234/ in the browser and I get the msg:
Error: secret option required for sessions
    at session (C:\Users\User\Desktop\WebApplicationWorkshop-master\node_modules\express-session\index.js:200:12)
    at Layer.handle [as handle_request] (C:\Users\User\Desktop\WebApplicationWorkshop-master\node_modules\express\lib\router\layer.js:95:5)
    at trim_prefix (C:\Users\User\Desktop\WebApplicationWorkshop-master\node_modules\express\lib\router\index.js:317:13)
    at C:\Users\User\Desktop\WebApplicationWorkshop-master\node_modules\express\lib\router\index.js:284:7
    at Function.process_params (C:\Users\User\Desktop\WebApplicationWorkshop-master\node_modules\express\lib\router\index.js:335:12)
    at next (C:\Users\User\Desktop\WebApplicationWorkshop-master\node_modules\express\lib\router\index.js:275:10)
    at urlencodedParser (C:\Users\User\Desktop\WebApplicationWorkshop-master\node_modules\body-parser\lib\types\urlencoded.js:91:7)
    at Layer.handle [as handle_request] (C:\Users\User\Desktop\WebApplicationWorkshop-master\node_modules\express\lib\router\layer.js:95:5)
    at trim_prefix (C:\Users\User\Desktop\WebApplicationWorkshop-master\node_modules\express\lib\router\index.js:317:13)
    at C:\Users\User\Desktop\WebApplicationWorkshop-master\node_modules\express\lib\router\index.js:284:7
    at Function.process_params (C:\Users\User\Desktop\WebApplicationWorkshop-master\node_modules\express\lib\router\index.js:335:12)
    at next (C:\Users\User\Desktop\WebApplicationWorkshop-master\node_modules\express\lib\router\index.js:275:10)
    at jsonParser (C:\Users\User\Desktop\WebApplicationWorkshop-master\node_modules\body-parser\lib\types\json.js:110:7)
    at Layer.handle [as handle_request] (C:\Users\User\Desktop\WebApplicationWorkshop-master\node_modules\express\lib\router\layer.js:95:5)
    at trim_prefix (C:\Users\User\Desktop\WebApplicationWorkshop-master\node_modules\express\lib\router\index.js:317:13)
    at C:\Users\User\Desktop\WebApplicationWorkshop-master\node_modules\express\lib\router\index.js:284:7
    at Function.process_params (C:\Users\User\Desktop\WebApplicationWorkshop-master\node_modules\express\lib\router\index.js:335:12)
    at next (C:\Users\User\Desktop\WebApplicationWorkshop-master\node_modules\express\lib\router\index.js:275:10)
    at SendStream.error (C:\Users\User\Desktop\WebApplicationWorkshop-master\node_modules\express\node_modules\serve-static\index.js:121:7)
    at SendStream.emit (events.js:400:28)
    at SendStream.error (C:\Users\User\Desktop\WebApplicationWorkshop-master\node_modules\express\node_modules\send\index.js:270:17)
    at SendStream.onStatError (C:\Users\User\Desktop\WebApplicationWorkshop-master\node_modules\express\node_modules\send\index.js:421:12)

Do you have any idea whats the problem? Thank you!

mm-wang commented 2 years ago

Yes, you are missing environment variables. As this was created for a workshop 3 years ago, there was an accompanying series of steps, including configuring a token to use Rhino Compute and a database. I am unfortunately not able to provide the workshop contents, but the error is pretty self explanatory - you need an environment variable for the application to validate the API calls from the client to the server that you are running. Anything you'll find after process.env. in all capitals will be a environment variable you require.

PORT: the port you want to run on RHINOCOMPUTE_TOKEN: token you get from signing on to rhino compute, which you would need to get separately SESSION_SECRET: a series of characters to authenticate from server to browser DATABASE_URI: a URI to a database that you've set up

1div0error commented 2 years ago

Many thanks for your help 🙏