Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Saroj Dhiman
/
fastapi
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 59fed9ee
authored
Nov 07, 2023
by
Saroj Dhiman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
main_file
1 parent
1a4120fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
main.py
main.py
0 → 100644
View file @
59fed9e
from
fastapi
import
FastAPI
# creating the instance of FastAPI
object
=
FastAPI
()
# make a decorator to utilize it
@object.get
(
"/"
)
# so whatever u write it will return on our interface
def
index
():
return
{
"keys"
:
"blog list"
}
# if i want to create a new page i need to create a function first and inside get i need to pass the name of the function.
@object.get
(
"/blog/{id}"
)
def
show
():
return
{
"keys"
:
id
}
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment