Talento90 / typescript-node

:clipboard: TypeScript and NodeJS project template.
MIT License
369 stars 78 forks source link

Some improvements #8

Closed thebergamo closed 8 years ago

thebergamo commented 8 years ago

Nice project! I love some decissions about the structure and other things, just some doubts about typescript, just for curiosity.

In your feature index.ts files, you send in the init method the Hapi Server, this server are not sended in the plugin's load?

By the way, I strong recomending you see this branch https://github.com/thebergamo/start-hapiness/tree/dev-2.0

Btw, again nice project :D

Talento90 commented 8 years ago

My init function in server.ts it's responsible to create the server and pass it through the plugins, then return the server.

I'll invest some time checking that branch! If you want to discuss something about this project or yours I'm available :)

Obrigado pelo feedback :+1:

thebergamo commented 8 years ago

I mean this init function: https://github.com/Talento90/typescript-node/blob/master/src/tasks/index.ts#L6

Maybe is just a confusion about TypeScript

Talento90 commented 8 years ago

I create an instance of server and then I pass it through all plugins and then all features.

plugin.register(server, pluginOptions);
Tasks.init(server, configs, database);
Users.init(server, configs, database);

https://github.com/Talento90/typescript-node/blob/master/src/server.ts

TypeScript is the same as JavaScript but better hehe :+1:

thebergamo commented 8 years ago

Haha that's right!

I'm not sure about TS better than JS :p

But looking your code, have some interesting features.