Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Descargar e instalar las Heroku CLI (Heroku Command Line Interface)
- https://devcenter.heroku.com/articles/heroku-cli#download-and-install
- Heroku CLI es un conjunto de herramientas que nos permitirán administrar nuestras
- aplicaciones de heroku a través de un terminal.
- Clonar el siguiente repositorio https://github.com/jesperorb/json-server-heroku:
- git clone https://github.com/jesperorb/json-server-heroku
- Una vez clonado el directorio, debemos ver los siguientes ficheros
- E:\Scratch\json-server-heroku>dir
- El volumen de la unidad E es DATOS
- El número de serie del volumen es: 3E80-0DF6
- Directorio de E:\Scratch\json-server-heroku
- 28/01/2019 18:32 <DIR> .
- 28/01/2019 18:32 <DIR> ..
- 28/01/2019 18:32 244 db.json
- 28/01/2019 18:31 408 package.json
- 28/01/2019 18:31 6.946 README.md
- 28/01/2019 18:31 282 server.js
- 4 archivos 7.880 bytes
- 2 dirs 4.156.588.032 bytes libres
- Posteriormente modificamos el fichero db.json y añadimos nuestra base de datos:
- {
- "Todos": [
- {
- "id": 1,
- "todo": "Pagar IGIC factura"
- },
- {
- "id": 2,
- "todo": "Redactar nueva propuesta"
- },
- {
- "id": 3,
- "todo": "Concretar reunión equipo de trabajo"
- }
- ]
- }
- Ahora tenemos que commitear nuestros cambios:
- E:\Scratch\json-server-heroku>git status
- On branch master
- Your branch is up-to-date with 'origin/master'.
- Changes not staged for commit:
- (use "git add <file>..." to update what will be committed)
- (use "git checkout -- <file>..." to discard changes in working directory)
- modified: db.json
- no changes added to commit (use "git add" and/or "git commit -a")
- E:\Scratch\json-server-heroku>git add .
- E:\Scratch\json-server-heroku>git commit -m "Base de datos para todo-app modificada"
- *** Please tell me who you are.
- Run
- git config --global user.email "you@example.com"
- git config --global user.name "Your Name"
- to set your account's default identity.
- Omit --global to set the identity only in this repository.
- fatal: unable to auto-detect email address (got 'jgargon@DESKTOP-O0N3N4V.(none)')
- Para poder realizar un commit es necesario configurar los parámetros user.email y user.name:
- E:\Scratch\json-server-heroku>git config --global user.email jonaygarciav@gmail.com
- E:\Scratch\json-server-heroku>git config --global user.name "Jonay Garcia"
- E:\Scratch\json-server-heroku>git commit -m "Base de datos para todo-app modificada"
- [master 0f398f4] Base de datos para todo-app modificada
- 1 file changed, 10 insertions(+), 10 deletions(-)
- Vemos que hemos hecho de manera correcta el commit:
- E:\Scratch\json-server-heroku>git log -1 --stat
- commit 0f398f4eb3527caa52bbba8eefabb1862941b88f
- Author: Jonay Garcia <jonaygarciav@gmail.com>
- Date: Mon Jan 28 18:35:37 2019 +0000
- Base de datos para todo-app modificada
- db.json | 20 ++++++++++----------
- 1 file changed, 10 insertions(+), 10 deletions(-)
- Nos logueamos en Heroku y creamos la app todoapp01:
- E:\Scratch\json-server-heroku>heroku login
- heroku: Press any key to open up the browser to login or q to exit:
- Logging in... done
- Logged in as jgglez79@gmail.com
- E:\Scratch\json-server-heroku>heroku create todoapp01
- Creating ⬢ todoapp01... done
- https://todoapp01.herokuapp.com/ | https://git.heroku.com/todoapp01.git
- Al crear la apliación, nos la ha conectado a nuestro repositorio:
- E:\Scratch\json-server-heroku>git remote -v
- heroku https://git.heroku.com/todoapp01.git (fetch)
- heroku https://git.heroku.com/todoapp01.git (push)
- origin https://github.com/jesperorb/json-server-heroku.git (fetch)
- origin https://github.com/jesperorb/json-server-heroku.git (push)
- Posteriormente subimos nuestro código a Heroku:
- E:\Scratch\json-server-heroku>git push heroku master
- Counting objects: 55, done.
- Delta compression using up to 8 threads.
- Compressing objects: 100% (54/54), done.
- Writing objects: 100% (55/55), 11.14 KiB | 0 bytes/s, done.
- Total 55 (delta 20), reused 0 (delta 0)
- remote: Compressing source files... done.
- remote: Building source:
- remote:
- remote: -----> Node.js app detected
- remote:
- remote: -----> Creating runtime environment
- remote:
- remote: NPM_CONFIG_LOGLEVEL=error
- remote: NODE_ENV=production
- remote: NODE_MODULES_CACHE=true
- remote: NODE_VERBOSE=false
- remote:
- remote: -----> Installing binaries
- remote: engines.node (package.json): unspecified
- remote: engines.npm (package.json): unspecified (use default)
- remote:
- remote: Resolving node version 10.x...
- remote: Downloading and installing node 10.15.0...
- remote: Using default npm version: 6.4.1
- remote:
- remote: -----> Building dependencies
- remote: Installing node modules (package.json)
- remote: added 223 packages from 121 contributors and audited 444 packages in 7.022s
- remote: found 0 vulnerabilities
- remote:
- remote:
- remote: -----> Caching build
- remote: - node_modules
- remote:
- remote: -----> Pruning devDependencies
- remote: audited 444 packages in 2.066s
- remote: found 0 vulnerabilities
- remote:
- remote:
- remote: -----> Build succeeded!
- remote: -----> Discovering process types
- remote: Procfile declares types -> (none)
- remote: Default types for buildpack -> web
- remote:
- remote: -----> Compressing...
- remote: Done: 20.1M
- remote: -----> Launching...
- remote: Released v3
- remote: https://todoapp01.herokuapp.com/ deployed to Heroku
- remote:
- remote: Verifying deploy... done.
- To https://git.heroku.com/todoapp01.git
- * [new branch] master -> master
- Subimos nuestro código a Heroku:
- E:\Scratch\json-server-heroku>git push heroku master
- ------------------------
- https://todoapp01.herokuapp.com/Todos
- https://randomapi.com/documentation
- https://github.com/codepath/android_guides/wiki/Consuming-APIs-with-Retrofit
- http://www.jsonschema2pojo.org/
- https://www.simplifiedcoding.net/retrofit-android-example/
- https://scotch.io/tutorials/json-server-as-a-fake-rest-api-in-frontend-development
- https://github.com/jesperorb/json-server-heroku
- https://code.tutsplus.com/es/tutorials/sending-data-with-retrofit-2-http-client-for-android--cms-27845
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement