Coder Social home page Coder Social logo

abcweb's People

Contributors

aarondl avatar demonshreder avatar nullbio avatar yml avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

abcweb's Issues

Any example about how to use the Session to manage the request validation?

The abcweb framework is the exact infrastructure that we are looking for in the golang full stack development environment. We are trying to put the RESTful API implementation, like the go-chi/chi style. This can easily work. But, each of API request has to be validated against the authenticated login session. I spotted that several places to enforce the session management:

In the NewRouter(), where creates the application routes, that binds with
root := controllers.Root{
Render: a.Render,
Session: a.Session,
}
which implicates the Controller is the place to implement such logic, right? I wonder how to add the session validation with the API processing that defines in the router.Route(...). Any sample codes or application can be real helpful.

Thanks. Nice framework!

-Richard

Remove `abc` prefix from the subpackages

This is the second time that I stumble on this project. I sent you a PR few days ago. There is something that annoyed me in your API. Some of your packages are prefix by ABC for no obvious reason. I think that removing this prefix will increase the readability and reduce the typing.

This is close from bikeshedding so feel free to ignore it and just close this issue :-).

Not using HTTP2

As far as I can tell its not using HTTP2 (in dev, at least)?

i used "HTTP/2 and SPDY indicator" for chrome and tried hitting myapp:4000. Indicates it's not using http2. sites like facebook.com or google.com indicate positively.

Websocket not working with router

I tried using the websocket library(melody) as well as other libraries but they don't work with abcweb. The websocket connection never opens. I also tried melody in a simple setup with chi router and it worked.

package main

import (
	"github.com/go-chi/chi"
	"gopkg.in/olahol/melody.v1"
	"net/http"
)

func main() {
	r := chi.NewRouter()
	m := melody.New()

	r.Get("/ws", func(w http.ResponseWriter, r *http.Request) {
		m.HandleRequest(w, r)
	})


	m.HandleMessage(func(s *melody.Session, msg []byte) {
		m.Broadcast(msg)
	})

	http.ListenAndServe(":3000", r)
}

I add the code below to the router in my abcweb router file and it doesn't work. Please can I get help on this issue?

router.Get("/ws", func(w http.ResponseWriter, r *http.Request) {
		m.HandleRequest(w, r)
	})

My Repo: https://github.com/fadeojo/brito

abcweb deps should run npm install (to avoid dependency errors on fresh machines)

It's not clear in the documentation that if you fork a project that was generated by abcweb and you've never generated an abcweb project before (run the abcweb new command which runs npm install) that you will need to manually run npm install in the root of the generated app to install the deps defined in package.json

This should probably be run every time abcweb deps is run, since that is usually the first point of call to get your deps up to date on a fresh system. It should check if the package.json file exists before running it.

Migrations don't work as advertised

Hello,

I'm getting excited about this project coming from a Rails background. Migrations don't seem to work as stated in the current documentation:

$ abcweb gen migration add_app_owners
error: cannot read file create
Error: exit status 1
Usage:
  abcweb gen migration <name> [flags]

Examples:
abcweb gen migration add_users

Flags:
  -h, --help   help for migration

This is an obvious show stopper for a beginner in abcweb or anyone, like myself, who's evaluating current Go frameworks for their next project.

Any ideas? I have my $GOPATH/bin first in my $PATH. (thought I'd mention it since there is another issue opened related to migrations currently)

Keep up the good work! Very exciting. Looking forward to evaluating again at some point.

Adam

abcweb livereload is broken

url should be using localhost:35729 not whatever port you're running the go server on -- livereload port is always the same, and gulp starts a server/websocket that listens for the livereload connection, not a Go route.

abcweb new output errors

When running abcweb new it does not appear to be outputting dep ensure errors correctly, even in verbose mode, however it should output errors when not in verbose mode as well.

`abcweb dev` pinning a core

Any way we can make it so it doesnt pin a core? Will chew through a laptop battery in no time, meaning I cant dev in a coffee shop or something.
A couple screenshots from activity monitor CPU and Energy tabs.

screen shot 2017-07-04 at 7 34 04 am

screen shot 2017-07-04 at 7 35 06 am

Aside: I know I've opened many issues, let me know which you'd like me to tackle.

Add SQLite support

Once SQLBoiler supports SQLite it will allow ABCWeb to function out of the box by utilizing its own SQLite database, instead of having the requirement to set up or configure Postgres or MySQL.

We will also need to add SQLite to the mig package.

Getting started additional steps

I had to do some additional stuff to start a new projects (on macosx)

brew install postgresql
brew services start postgresql
createuser -P myapp
createdb myapp

abcweb migrate status error

Mac OSX already has a mig (Mach Interface Generator tool) executable in /usr/bin. This hinders abcweb from installing and calling volatiletech/mig

> abcweb migrate status
error: cannot read file status
Error: exit status 1
Usage:
  abcweb migrate status [flags]

Flags:
  -h, --help   help for status

Global Flags:
      --db string    Valid options: postgres|mysql (default: "config.toml db field")
  -e, --env string   The config.toml file environment to load (default "dev")

abcweb new failed to copy templates on project with multiple GOPATH

Env:
Windows 10 64bit
Go 1.8.3 64bit

Step to introduce:

  1. Install abcweb to first gopath (called go-base)
  2. Add second gopath (called cashkit)
  3. Run abcweb new

Expected:
Application generate new project

Result:
Failed with error: cannot locate base path containing templates folder

Output:
$ abcweb new gitlab.com/xxx/cashkit/
Your GOPATH has multiple paths, select your desired GOPATH:
[1] C:\Users\Airlangga\Projects\cashkit
[2] C:\Users\Airlangga\Application\go-base
Select GOPATH number: 1
1
Generating in: C:\Users\Airlangga\Projects\cashkit\src\gitlab.com\xxx\cashkit
Error: cannot locate base path containing templates folder
Usage:
abcweb new <import_path> [flags]

Examples:
abcweb new github.com/yourusername/myapp

... *cutout to reduce noise

$ echo %GOPATH%
C:\Users\Airlangga\Projects\cashkit;C:\Users\Airlangga\Application\go-base

http to https redirect fails when not on test port

Review patch:

+++ b/vendor/github.com/volatiletech/abcweb/abcserver/server.go
@@ -1,6 +1,7 @@
 package abcserver

 import (
+       "bytes"
        "context"
        "crypto/tls"
        "fmt"
@@ -9,6 +10,7 @@ import (
        "net/http"
        "os"
        "os/signal"
+       "strings"

        "github.com/go-chi/chi"
        "github.com/pkg/errors"
@@ -108,13 +110,23 @@ func Redirect(cfg abcconfig.ServerConfig, logger *zap.Logger) {
                ErrorLog:     log.New(serverErrLogger{logger}, "", 0),
                Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
                        // Remove port if it exists so we can replace it with https port
-                       var httpHost string
-                       httpHost, _, err = net.SplitHostPort(r.Host)
-                       if err != nil {
-                               log.Fatal("failed to get http host from request", zap.Error(err))
+                       httpHost := r.Host
+                       if strings.ContainsRune(r.Host, ':') {
+                               httpHost, _, err = net.SplitHostPort(r.Host)
+                               if err != nil {
+                                       log.Fatal("failed to get http host from request", zap.Error(err))
+                               }
                        }
-
-                       url := fmt.Sprintf("https://%s:%s%s", httpHost, httpsPort, r.RequestURI)
+                       b := bytes.Buffer{}
+                       b.WriteString("https://")
+                       b.WriteString(httpHost)
+                       if httpsPort != "443" {
+                               b.WriteByte(':')
+                               b.WriteString(httpsPort)
+                       }
+                       b.WriteString(r.RequestURI)
+                       url := b.String()
+                       logger.Info("redirect", zap.String("origin", r.Host), zap.String("origin-path", r.URL.String()), zap.String("url", url))
                        http.Redirect(w, r, url, http.StatusMovedPermanently)
                }),
        }

Streamline abcweb deps command

abcweb deps should only install gulp and the deps tool. The rest of the dependencies should be fetched by dep itself in the dep ensure stage.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.