These are chat archives for NathanBland/hyper-cli

31st
Mar 2016
Nathan Bland
@NathanBland
Mar 31 2016 00:50
Now that I think about it
It would be sweet to have the generated stuff stored in a hyper-config.json
So you could push less, and only have to commit your customized items
@crodeheaver thoughts?
Colby Rodeheaver
@crodeheaver
Mar 31 2016 02:14
Hmmm.... I'm not a hundred percent sure what you're going for. Do you mean store all the configuration information stored in a json file?
and can be generated off that information?
or hyper is a json api server that reads in the hyper-config.json file and dynamically creates all the routes and everything based off of that?
Nathan Bland
@NathanBland
Mar 31 2016 02:24
The first kind
Colby Rodeheaver
@crodeheaver
Mar 31 2016 13:27
Ok, so what kind of configuration information are we talking about here?
Hooks, port, ip, db, ect...?
Nathan Bland
@NathanBland
Mar 31 2016 14:01
Let me see if I can cook up a mock one..
Nathan Bland
@NathanBland
Mar 31 2016 14:11
@crodeheaver
{
  "api" : {
    "name" : "mock-api",
    "port" : 8081,
    "ip" : "127.0.0.1",
    "authRequired" : false,
    "path" : "/api",
    "routes" : [
        {
          "path" : "/post",
          "resourceModel" : "post",
          "extendable" : true,
          "authRequired" : false,
          "methods" : ["post", "get"],
          "routes" : [
              {
                "path" : "/post/id",
                "resourceModel" : "post",
                "methods" : ["get"],
                "extendable" : true,
                "authRequired" : false
              }
          ] 
        }
    ]
  }    
}
^^ this is kind of what I meant
though there should probably be more configuration options
I just don't know what they are yet
Colby Rodeheaver
@crodeheaver
Mar 31 2016 14:12
mongo/mongoose info
Nathan Bland
@NathanBland
Mar 31 2016 14:12
ah true
db_host
Colby Rodeheaver
@crodeheaver
Mar 31 2016 14:12
So are there separate route files for those routes, or will they be generated based off of this config?
Nathan Bland
@NathanBland
Mar 31 2016 14:12
yes.
the generate function of the cli will do two things
1) generate this part of a config file
2) generate the actual folder that contains the .js file, and extendable .js files if that option is passed
but won't override the extendable ones if they exist
Colby Rodeheaver
@crodeheaver
Mar 31 2016 14:14
So the idea is that you could potentially use this config file to generate the entire project? or most of it.
Nathan Bland
@NathanBland
Mar 31 2016 14:14
The api portion anyway, yes
is my thought
but that's just one idea
I'm open to whatever
Eventually, this would let you pick your database type as well
so it wasn't locked only to mongo/mongoose
Colby Rodeheaver
@crodeheaver
Mar 31 2016 14:16
Now that will be a challenge, because if we're generating the calls to the database, we would have to have some sort of orm type on top.
Nathan Bland
@NathanBland
Mar 31 2016 14:17
right
I think it would make sense to use http://docs.sequelizejs.com/en/latest/ for that
but that's a lofty goal
that isn't an immediate concern
but something that I bet a lot of people would find handy
Colby Rodeheaver
@crodeheaver
Mar 31 2016 14:18
True. sequelize is a pain in the butt though.
Nathan Bland
@NathanBland
Mar 31 2016 14:19
Oh I believe it
but isn't that half the point of this thing?
to remove having to deal with that?
here is a revised mock
{
  "api" : {
    "name" : "mock-api",
    "port" : 8081,
    "ip" : "127.0.0.1",
    "db_type" : "mongo",
    "db_host" : "127.0.0.1",
    "db_port" : 27017,
    "authRequired" : false,
    "path" : "/api",
    "routes" : [
        {
          "path" : "/post",
          "resourceModel" : "post",
          "extendable" : true,
          "authRequired" : false,
          "methods" : ["post", "get"],
          "routes" : [
              {
                "path" : "/post/id",
                "resourceModel" : "post",
                "methods" : ["get"],
                "extendable" : true,
                "authRequired" : false
              }
          ] 
        }
    ]
  }    
}
I should probably be consistent with either camel case or using _
but...
whoops.
Colby Rodeheaver
@crodeheaver
Mar 31 2016 14:20
I'm a bit partial to snake case myself, but camel is pretty popular
It seems like every project uses a different style
Nathan Bland
@NathanBland
Mar 31 2016 14:21
it does
which means we would just need to pick one and go with it
Nathan Bland
@NathanBland
Mar 31 2016 17:39
@crodeheaver would you mind putting together an ember app with models for a simple blog? I could use a boilerplate to go off of
if not I will probably mess with that first
just to see what stuff ends up looking like
Colby Rodeheaver
@crodeheaver
Mar 31 2016 17:41
Ya. I'll try to do that.
Nathan Bland
@NathanBland
Mar 31 2016 17:41
sweet, thanks
Nathan Bland
@NathanBland
Mar 31 2016 17:52
@crodeheaver does ember do all of its routing client side, or does it actually request them from the server?
Colby Rodeheaver
@crodeheaver
Mar 31 2016 18:17
Server side
Unless I've been lied to.
Which is possible
Nathan Bland
@NathanBland
Mar 31 2016 18:18
haha
ok