Skip to content

Instantly share code, notes, and snippets.

@kaniket7209
Created December 4, 2021 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaniket7209/18820bedb04a2e48b11273d97000d865 to your computer and use it in GitHub Desktop.
Save kaniket7209/18820bedb04a2e48b11273d97000d865 to your computer and use it in GitHub Desktop.
Getting our App ready for Heroku
1. What is Procfile in node?
Answer: Procfile is a mechanism for declaring what commands are run by your application's dynos on the Heroku platform.
2. How do I run a Procfile locally?
Answer: To start your app locally follow the below steps:
a) To use a different Procfile, use the -f flag: heroku local -f Procfile. test .
b) To use a different environment file, use the -e flag: heroku local -e . env. test .
c) To use a different port, use the -p flag: heroku local -p 7000 . If you don't specify a port, 5000 is used.
3. Where do I put Procfile?
Answer: A Procfile should be a text file, called Procfile , sitting in the root directory of your app. It's the same for Windows or Linux or OS X.
4. What is the use of Gunicorn?
Answer: Gunicorn is an application server for running your python application instance. NGINX is a reverse proxy. It accepts incoming connections and decides where they should go next. It is in front of Gunicorn.
5. Do I need Gunicorn with flask?
Answer: Although Flask has a built-in web server, as we all know, it's not suitable for production and needs to be put behind a real web server able to communicate with Flask through a WSGI protocol. A common choice for that is Gunicorn—a Python WSGI HTTP server.
1. What is the correct synyax for making runtime file
a) Runtime.txt
b) runtime.md
c) runtime.txt
d) runtime
Answer: c)
2. Chhose the correct syntax from below to store python details in runtime.txt file
a) Python 3-9-0
b) Python 3.9.0
c) python-3.9.0
d) python 3.9.0
Answwr: c)
3. How we run our app in flask
a) By clicking the run button on the top right corner
b) By writting command flask run in terminal
c) By writting command node app.py
d) By writting command python app.py
Answer: b)
4. What is the library that we use as an alternative for flask run while using heroku for deployment
a) pymongo
b) gunicorn
c) Procfile
d) flask
Answer: b)
5. What is the correct syntax of making procfile
a) Procfile.txt
b) procfile.txt
c) Procfile
d) procfile
Answer: c)
6. CHoose the correct synatx for the command that we write under Procfile
a) web: gunicorn app.create_app()
b) web: "gunicorn app.create_app()"
c) web: gunicorn "app.create_app()"
d) "web: gunicorn app.create_app()"
Answer: c)
7. Is NodeJs faster than Python
a) yes
b) no
Answer: a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment