gobuffalo / vuerecipe Goto Github PK
View Code? Open in Web Editor NEWA recipe for using Buffalo & Vue.js
A recipe for using Buffalo & Vue.js
buffalo: 2018/07/24 14:52:52 === Error! ===
buffalo: 2018/07/24 14:52:52 === exit status 1
main.go:6:2: cannot find package "github.com/gobuffalo/vuerecipe/actions" in any of:
/usr/lib/go-1.10/src/github.com/gobuffalo/vuerecipe/actions (from $GOROOT)
/usr/local/go/src/github.com/gobuffalo/vuerecipe/actions (from $GOPATH)
What is the issue here pls ?
I need to use a project generated by vue cli. which adjustments do i make?
of course it uses webpack behind the scenes.
Browsers have a tendency to always try to fetch /favicon.ico, even if you don't define a favicon in the HTML head section browsers will still try to fetch /favicon.ico all the time.
The issue with the catch-all route "/{path:.+}" is that it's also picking up /favicon.ico, this leads to an error and 500 status code:
ERRO[2018-01-14T22:16:19+13:00] application.html: authenticity_token: unknown identifier content_type=image/webp db=0s duration="390.287µs" human_size="0 B" method=GET params="{"path":["favicon.ico"]}" path=/favicon.ico render="103.789µs" request_id=466c9136c3-1fc13a7c77 size=0 status=0
This basically means every /favicon.ico request is going to get a 500 status code back, it seems to be something to do with authenticity_token.
Running docker build fails
docker build .
Error:
Step 8/16 : RUN go get $(go list ./... | grep -v /vendor/)
---> Running in a6541d3d0389
../buffalo/render/helpers.go:10:2: cannot find package "github.com/gobuffalo/tags" in any of:
/usr/local/go/src/github.com/gobuffalo/tags (from $GOROOT)
/go/src/github.com/gobuffalo/tags (from $GOPATH)
models/band.go:8:2: cannot find package "github.com/gobuffalo/validate" in any of:
/usr/local/go/src/github.com/gobuffalo/validate (from $GOROOT)
/go/src/github.com/gobuffalo/validate (from $GOPATH)
The command '/bin/sh -c go get $(go list ./... | grep -v /vendor/)' returned a non-zero code: 1
Ubuntu 18.04.01 Server Edition
marco@pc01:~/go/src/vuerecipe$ buffalo db create -a
v4.11.1
[POP] 2019/06/17 17:27:33 info - create vuerecipe_development
(postgres://postgres:[email protected]:5432/vuerecipe_development?sslmode=disable)
[POP] 2019/06/17 17:27:33 info - created database vuerecipe_development
[POP] 2019/06/17 17:27:33 info - create vuerecipe_test
(postgres://postgres:[email protected]:5432/vuerecipe_test?sslmode=disable)
[POP] 2019/06/17 17:27:33 info - created database vuerecipe_test
[POP] 2019/06/17 17:27:33 info - create vuerecipe_production
(postgres://postgres:[email protected]:5432/vuerecipe_production?sslmode=disable)
[POP] 2019/06/17 17:27:33 info - created database vuerecipe_production
marco@pc01:~/go/src/vuerecipe$ buffalo dev
buffalo: 2019/06/17 17:34:56 === Rebuild on: :start: ===
buffalo: 2019/06/17 17:34:56 === Running: go build -v -i -tags development -o tmp/vueband-
build (PID: 24959) ===
main.go:6:2: cannot find package "github.com/gobuffalo/vuerecipe/actions" in any of:
/home/marco/.go/src/github.com/gobuffalo/vuerecipe/actions (from $GOROOT)
/home/marco/go/src/github.com/gobuffalo/vuerecipe/actions (from $GOPATH)
buffalo: 2019/06/17 17:34:56 === Error! ===
buffalo: 2019/06/17 17:34:56 === exit status 1
main.go:6:2: cannot find package "github.com/gobuffalo/vuerecipe/actions" in any of:
/home/marco/.go/src/github.com/gobuffalo/vuerecipe/actions (from $GOROOT)
/home/marco/go/src/github.com/gobuffalo/vuerecipe/actions (from $GOPATH)
===
webpack is watching the files…
Live Reload listening on port 35729
Hash: 5102adc4a4d7732457cc
Version: webpack 4.5.0
Time: 1737ms
Built at: 2019-6-17 17:34:58
Asset Size Chunks Chunk Names
674f50d287a8c48dc19ba404d20fe713.eot 162 KiB [emitted]
application.be0e7bdbb4250faec706.css 1.15 MiB application [emitted] application
application.5102adc4a4d7732457cc.js 1.11 MiB application [emitted] application
images/logo.svg 64.4 KiB [emitted]
manifest.json 224 bytes [emitted]
Entrypoint application = application.be0e7bdbb4250faec706.css
application.5102adc4a4d7732457cc.js
[./assets/css/application.scss] 39 bytes {application} [built]
[./assets/js/application.js] 560 bytes {application} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 509 bytes {application}
[built]
[0] multi ./assets/js/application.js ./node_modules/jquery-ujs/src/rails.js ./assets
/css/application.scss 52 bytes {application} [built]
+ 27 hidden modules
Child mini-css-extract-plugin node_modules/css-loader/index.js??ref--2-1!node_modules/sass-
loader/lib/loader.js??ref--2-2!assets/css/application.scss:
Entrypoint mini-css-extract-plugin = *
[./node_modules/css-loader/index.js??ref--2-1!./node_modules/sass-loader
/lib/loader.js??ref--2-2!./assets/css/application.scss] ./node_modules/css-loader??ref--
2-1!./node_modules/sass-loader/lib/loader.js??ref--2-2!./assets/css/application.scss 378 KiB
{mini-css-extract-plugin} [built]
+ 9 hidden modules
In browser:
502 Bad Gateway
nginx/1.17.0
Good day. Does indexing occur in search engines in this approach?
In Ubuntu 18.04.01 Server Edition
marco@pc01:~/go/src/github.com/gobuffalo/vuerecipe$ npm install
> [email protected] install /home/marco/go/src/github.com/gobuffalo/vuerecipe/node_modules
/node-sass
> node scripts/install.js
Cached binary found at /home/marco/.npm/node-sass/4.9.4/linux-x64-57_binding.node
> [email protected] postinstall /home/marco/go/src/github.com/gobuffalo/vuerecipe/node_modules
/core-js-pure
> node scripts/postinstall || echo "ignore"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard
library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
> [email protected] postinstall /home/marco/go/src/github.com/gobuffalo/vuerecipe/node_modules
/node-sass
> node scripts/build.js
Binary found at /home/marco/go/src/github.com/gobuffalo/vuerecipe/node_modules/node-
sass/vendor/linux-x64-57/binding.node
Testing binary
Binary is fine
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]
(node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]:
wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
added 753 packages from 445 contributors and audited 9076 packages in 9.839s
found 2 moderate severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
marco@pc01:~/go/src/github.com/gobuffalo/vuerecipe$ npm audit fix
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]
(node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]:
wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
+ [email protected]
updated 1 package in 2.652s
fixed 2 of 2 vulnerabilities in 9076 scanned packages
After adding .env file:
marco@pc01:~/go/src/github.com/gobuffalo/vuerecipe$ cat .env
# This .env file was generated by buffalo, add here the env variables you need
# buffalo to load into the ENV on application startup so your application works correctly.
# To add variables use KEY=VALUE format, you can later retrieve this in your application
# by using os.Getenv("KEY").
#
# Example:
# DATABASE_PASSWORD=XXXXXXXXX
# SESSION_SECRET=XXXXXXXXX
# SMTP_SERVER=XXXXXXXXX
ADDR=192.168.1.7
PORT=8080
everything seems working:
marco@pc01:~/go/src/github.com/gobuffalo/vuerecipe$ buffalo db create -a
v4.11.1
[POP] 2019/06/18 09:35:08 info - create vuerecipe_test
(postgres://postgres:[email protected]:5432/vuerecipe_test?sslmode=disable)
[POP] 2019/06/18 09:35:08 info - created database vuerecipe_test
[POP] 2019/06/18 09:35:08 info - create vuerecipe_production
(postgres://postgres:[email protected]:5432/vuerecipe_production?sslmode=disable)
[POP] 2019/06/18 09:35:08 info - created database vuerecipe_production
[POP] 2019/06/18 09:35:08 info - create vuerecipe_development
(postgres://postgres:[email protected]:5432/vuerecipe_development?sslmode=disable)
[POP] 2019/06/18 09:35:09 info - created database vuerecipe_development
marco@pc01:~/go/src/github.com/gobuffalo/vuerecipe$ buffalo dev
buffalo: 2019/06/18 09:35:15 === Rebuild on: :start: ===
buffalo: 2019/06/18 09:35:15 === Running: go build -v -i -tags development -o tmp/vueband-
build (PID: 5216) ===
github.com/gobuffalo/uuid
github.com/gobuffalo/vuerecipe/models
github.com/gobuffalo/vuerecipe/actions
github.com/gobuffalo/vuerecipe
webpack is watching the files…
Live Reload listening on port 35729
buffalo: 2019/06/18 09:35:17 === Building Completed (PID: 5216) (Time: 1.399445678s) ===
buffalo: 2019/06/18 09:35:17 === Running: tmp/vueband-build (PID: 5343) ===
INFO[2019-06-18T09:35:17Z] Starting application at 192.168.1.7:8080
INFO[2019-06-18T09:35:17Z] Starting Simple Background Worker
Hash: 9bbef17734f9c21a9dc1
Version: webpack 4.5.0
Time: 1852ms
Built at: 2019-6-18 09:35:18
Asset Size Chunks Chunk Names
674f50d287a8c48dc19ba404d20fe713.eot 162 KiB [emitted]
application.dcd7836825b84bd82e0e.css 1.15 MiB application [emitted] application
application.9bbef17734f9c21a9dc1.js 857 KiB application [emitted] application
images/logo.svg 64.4 KiB [emitted]
manifest.json 224 bytes [emitted]
Entrypoint application = application.dcd7836825b84bd82e0e.css
application.9bbef17734f9c21a9dc1.js
[./assets/css/application.scss] 39 bytes {application} [built]
[./assets/js/application.js] 560 bytes {application} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 509 bytes
{application} [built]
[0] multi ./assets/js/application.js ./node_modules/jquery-ujs/src/rails.js ./assets
/css/application.scss 52 bytes {application} [built]
+ 26 hidden modules
Child mini-css-extract-plugin node_modules/css-loader/index.js??ref--2-1!node_modules
/sass-loader/lib/loader.js??ref--2-2!assets/css/application.scss:
Entrypoint mini-css-extract-plugin = *
[./node_modules/css-loader/index.js??ref--2-1!./node_modules/sass-loader
/lib/loader.js??ref--2-2!./assets/css/application.scss] ./node_modules/css-loader??ref--
2-1!./node_modules/sass-loader/lib/loader.js??ref--2-2!./assets/css/application.scss 379 KiB
{mini-css-extract-plugin} [built]
+ 9 hidden modules
But when trying to accessing the url with the browser:
INFO[2019-06-18T09:36:09Z] / content_type=text/html db=0s duration=8.389305ms
human_size="712 B" method=GET params="{}" path=/ render="946.623µs"
request_id=VcpStVMygy-dKbJlWzimF size=712 status=200
DEBU[2019-06-18T09:36:10Z] SELECT bands.bio, bands.created_at, bands.id,
bands.name, bands.updated_at FROM bands AS bands LIMIT 20 OFFSET 0
INFO[2019-06-18T09:36:10Z] /api/bands/ content_type=application/json db="531.149µs"
duration=1.145986ms human_size="0 B" method=GET params="{}" path=/api/bands/
request_id=VcpStVMygy-CllAxMukZO size=0 status=0
ERRO[2019-06-18T09:36:10Z] unable to fetch records: pq: relation "bands" does not exist
content_type=application/json db="531.149µs" duration=1.145986ms human_size="0 B"
method=GET params="{}" path=/api/bands/ request_id=VcpStVMygy-CllAxMukZO size=0
status=0
INFO[2019-06-18T09:36:22Z] / content_type=text/html db=0s duration=1.519463ms
human_size="712 B" method=GET params="{}" path=/ render="743.381µs"
request_id=VcpStVMygy-dzEEczxYba size=712 status=200
DEBU[2019-06-18T09:36:22Z] SELECT bands.bio, bands.created_at, bands.id,
bands.name, bands.updated_at FROM bands AS bands LIMIT 20 OFFSET 0
INFO[2019-06-18T09:36:22Z] /api/bands/ content_type=application/json db="504.044µs"
duration=1.431836ms human_size="0 B" method=GET params="{}" path=/api/bands/
request_id=VcpStVMygy-rAovaohMYV size=0 status=0
ERRO[2019-06-18T09:36:22Z] unable to fetch records: pq: relation "bands" does not exist
content_type=application/json db="504.044µs" duration=1.431836ms human_size="0 B"
method=GET params="{}" path=/api/bands/ request_id=VcpStVMygy-rAovaohMYV size=0
status=0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.