feathers-plus / cli

FeathersJS CLI supporting both REST and GraphQL architectural concepts and their query languages.
https://generator.feathers-plus.com/
Other
43 stars 7 forks source link

Use https on new Feathers (Buzzard) with typescript #22

Closed vigalo closed 5 years ago

vigalo commented 5 years ago

Hello: I'm trying to update my feathers server from Auk to the new Buzzard. I'm using the new feathers-plus cli because i'm interested in using typescript on server, and GraphicQL.

My old Auk server is working correctly with https configuration, loading the certs and initializing the app :

`const fs = require('fs'); const https = require('https');

const privateKey = fs.readFileSync('/etc/ssl/private/sigalo.key'); const certificate = fs.readFileSync('/etc/ssl/certs/sigalo.cert'); const ca = fs.readFileSync('/etc/ssl/certs/www_sigalo_es.ca-bundle');

const credentials = {key: privateKey, cert: certificate, ca: ca};

const server = https.createServer(credentials, app).listen(8282);

app.setup(server); `

But now, with the new generated app.ts generated by cli+ I don't know how to make it to work and where is the correct block where tu put the imports, initialization, etc to avoid lose it in regeneration.

Can you help me? Thanks

eddyystop commented 5 years ago

You can always freeze a module, preventing it from being regenerated, by adding its path to options.freeze in feathers-gen-specs.json. For example

freeze: [ 'src/app.js' ],

Would you mind sending me a diff between a normally generated module and your once you have https implemented. We may want to make https support a cli+ option.

eddyystop commented 5 years ago

I'm moving this issue to feathers-plus/generate-feathers-plus

https://github.com/feathers-plus/generator-feathers-plus/issues/111

vigalo commented 5 years ago

You can always freeze a module, preventing it from being regenerated, by adding its path to options.freeze in feathers-gen-specs.json. For example

freeze: [ 'src/app.js' ],

Would you mind sending me a diff between a normally generated module and your once you have https implemented. We may want to make https support a cli+ option.

Ok, thanks.

I attach the diff of index.ts once https implemented, as you requested. diff.txt

eddyystop commented 5 years ago

How do I use that diff.txt? Alternatively you send me your version of the changed modules and I can diff them myself.

vigalo commented 5 years ago

Hello I only changed index.ts as is attached :

index.zip

eddyystop commented 5 years ago

Thanks!