hack4impact-calpoly / youth-arts

Hack4Impact Cal Poly nonprofit project for Paso Robles Youth Arts Center
6 stars 2 forks source link

test backend #138

Open ryanhu021 opened 1 year ago

ryanhu021 commented 1 year ago

Test the backend routes and reply to this issue with your findings.

You can ignore the linting errors.

joieng1 commented 1 year ago

The server crashes on runtime:

throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn)) ^

TypeError: Router.use() requires a middleware function but got a string at Function.use (/Users/johnieng/Desktop/youthArts/backend/node_modules/express/lib/router/index.js:469:13) at Function. (/Users/johnieng/Desktop/youthArts/backend/node_modules/express/lib/application.js:227:21) at Array.forEach () at Function.use (/Users/johnieng/Desktop/youthArts/backend/node_modules/express/lib/application.js:224:7) at Object. (/Users/johnieng/Desktop/youthArts/backend/server.js:24:5) at Module._compile (node:internal/modules/cjs/loader:1103:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) at node:internal/main/run_main_module:17:47

KimLinhVu commented 1 year ago

The server crashes on runtime:

throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn)) ^

TypeError: Router.use() requires a middleware function but got a string at Function.use (/Users/johnieng/Desktop/youthArts/backend/node_modules/express/lib/router/index.js:469:13) at Function. (/Users/johnieng/Desktop/youthArts/backend/node_modules/express/lib/application.js:227:21) at Array.forEach () at Function.use (/Users/johnieng/Desktop/youthArts/backend/node_modules/express/lib/application.js:224:7) at Object. (/Users/johnieng/Desktop/youthArts/backend/server.js:24:5) at Module._compile (node:internal/modules/cjs/loader:1103:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) at node:internal/main/run_main_module:17:47

I opened a pull request that I think fixed the issue.