fastify/fastify-example-twitter

How to run?

lgertel opened this issue · 3 comments

Hello everyone! I'm evaluating fastify, but facing some issues to run this project.

`➜ fastify-example-twitter git:(master) npm start -- --log-level trace --port 3001

server@1.0.0 start /Users/lgertel/fastify-example-twitter
fastify index.js "--log-level" "trace" "--port" "3001"

AsyncFunction
assert.js:663
throw newErr;
^

AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Cannot destructure property ObjectId of 'undefined' or 'null'.
at listen (/Users/lgertel/fastify-example-twitter/node_modules/fastify/node_modules/fastify-cli/cli.js:96:12)
at /Users/lgertel/fastify-example-twitter/node_modules/fastify/fastify.js:209:23
at Function._encapsulateThreeParam (/Users/lgertel/fastify-example-twitter/node_modules/avvio/boot.js:297:7)
at Boot.callWithCbOrNextTick (/Users/lgertel/fastify-example-twitter/node_modules/avvio/boot.js:252:5)
at release (/Users/lgertel/fastify-example-twitter/node_modules/fastq/queue.js:127:16)
at Object.resume (/Users/lgertel/fastify-example-twitter/node_modules/fastq/queue.js:61:7)
at Plugin.loadPlugin.call (/Users/lgertel/fastify-example-twitter/node_modules/avvio/boot.js:141:22)
at registerRoutes (/Users/lgertel/fastify-example-twitter/tweet/index.js:51:32)
at Plugin.exec (/Users/lgertel/fastify-example-twitter/node_modules/avvio/plugin.js:33:17)
at Boot.loadPlugin (/Users/lgertel/fastify-example-twitter/node_modules/avvio/plugin.js:114:10)
at Task.release (/Users/lgertel/fastify-example-twitter/node_modules/fastq/queue.js:127:16)
at worked (/Users/lgertel/fastify-example-twitter/node_modules/fastq/queue.js:169:10)
at toLoad.finish (/Users/lgertel/fastify-example-twitter/node_modules/avvio/plugin.js:117:7)
at done (/Users/lgertel/fastify-example-twitter/node_modules/avvio/plugin.js:74:7)
at check (/Users/lgertel/fastify-example-twitter/node_modules/avvio/plugin.js:86:7)
at process._tickCallback (internal/process/next_tick.js:61:11)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! server@1.0.0 start: fastify index.js "--log-level" "trace" "--port" "3001"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the server@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/lgertel/.npm/_logs/2018-05-30T20_49_55_734Z-debug.log
➜ fastify-example-twitter git:(master)`

I'm following the readme. Cloned the repo and tryed to run both dev and other option too.
Anyone can help me?

Hi!
currently this project runs a very old fastify version but following the instructions I was able to run this project:

$ git clone git@github.com:fastify/fastify-example-twitter.git
$ cd fastify-example-twitter
$ npm i
$ cd frontend && npm i && cd ..
$ cd frontend && npm run build && cd ..
$ npm start -- --log-level trace --port 3001

Do you have any open source or boilerplate with all best pratices?
No luck with this one yet, ill see my env versions. Thanks!

You can use https://github.com/fastify/fastify-cli#generate to generate a boilerplate.