Pabloin / techu-backend

techu-backend
1 stars 0 forks source link

Backend API REST #3

Closed Pabloin closed 5 years ago

Pabloin commented 5 years ago

TODO

DOING

DONE

DISCARTED

Pabloin commented 5 years ago

TODO

DOING

DONE

NOTAS

Pabloin commented 5 years ago
Pabloin commented 5 years ago

TODO

DOING

DONE

NOTA 3 Scale de redhat es pago

Algo parecido en la linea de Swagger es "SwaggerHub" https://swagger.io/tools/swaggerhub/

Pabloin commented 5 years ago

TODO

DOING

DONE

Este es mejor ... y este otro también me gusta ...

https://app.swaggerhub.com/apis/None696/user-informations/1.3.1 https://app.swaggerhub.com/apis/nutes.ocariot/account-service/v1#/

Algo bueno: en el "swaggerhub" tengo el "OpenBanking5": por ejemplo:

https://app.swaggerhub.com

https://app.swaggerhub.com/apis/OpenBanking5/next-gen_psd_2_xs_2_a_framework/1.3.4.12.BOI#/Account%20Information%20Service%20(AIS)/getAccountList

OK! Tengo el YAML con la API ... ¿Como lo convierto en un backend nodejs ... ?

Pruebo a:

https://github.com/fmvilas/swagger-node-codegen
npm install -g swagger-node-codegen

npm install -g swagger-node-codegen

pablo @ HP-wk ~/Escritorio/DevOps/code/github/Pabloin/techu-backend (feature/ID-#3-Backend-API-REST)
└─ $ ▶ npm install -g swagger-node-codegen
/home/pablo/.nvm/versions/node/v9.11.2/bin/snc -> /home/pablo/.nvm/versions/node/v9.11.2/lib/node_modules/swagger-node-codegen/cli.js
+ swagger-node-codegen@1.6.3
added 30 packages from 70 contributors in 28.725s

¿Que pasó ... ?

pablo @ HP-wk ~/Escritorio/DevOps/code/github/Pabloin/techu-backend/_PoC/openapi_bank (feature/ID-#3-Backend-API-REST)
└─ $ ▶ snc swagger.yaml 
Done! ✨
Check out your shiny new API at /home/pablo/Escritorio/DevOps/code/github/Pabloin/techu-backend/_PoC/openapi_bank.

ok! Observamos que tenemos todo generado!

node 10:

nvm use techu

npm install -g swagger-node-codegen

snc swagger.yaml

image

¿Y funciona ... levanta ... ?

^Cpablo @ HP-wk ~/Escritorio/DevOps/code/github/Pabloin/techu-backend/_PoC/openapi_bank (feature/ID-#4-login-user-backend)
└─ $ ▶ node src/bin/www 
{"name":"Techu Open API Bank","hostname":"HP-wk","pid":32630,"level":20,"msg":"Listening on port 3000","time":"2019-08-21T22:51:01.861Z","v":0}
{"name":"Techu Open API Bank","hostname":"HP-wk","pid":32630,"level":50,"msg":"Error 404 on /favicon.ico.","time":"2019-08-21T22:51:09.277Z","v":0}
{"name":"Techu Open API Bank","hostname":"HP-wk","pid":32630,"level":50,"msg":"Error 404 on /favicon.ico.","time":"2019-08-21T22:51:09.277Z","v":0}

Si!

image

Excelente!! :)

Pabloin commented 5 years ago
 > techu | techu_tf 
Now using node v10.16.1 (npm v6.9.0)
pablo @ HP-wk ~/Escritorio/DevOps/code/github/_techu
└─ $ ▶ npm install -g @loopback/cli