Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
assignment
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sandeep Jha
assignment
Commits
599bec11
Commit
599bec11
authored
Feb 14, 2024
by
Sandeep Jha
Browse files
Options
Downloads
Patches
Plain Diff
git learning
parent
5a50a642
No related branches found
No related tags found
1 merge request
!1
git learning
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app.js
+0
-37
0 additions, 37 deletions
app.js
server.js
+0
-0
0 additions, 0 deletions
server.js
with
0 additions
and
37 deletions
app.js
deleted
100644 → 0
+
0
−
37
View file @
5a50a642
const
express
=
require
(
'
express
'
)
const
app
=
express
()
const
PORT
=
process
.
env
.
PORT
||
8080
app
.
use
(
express
.
json
())
//get api
app
.
get
(
'
/api/v1/:id
'
,(
req
,
res
)
=>
{
const
id
=
req
.
params
.
id
const
name
=
req
.
query
.
name
const
response
=
{
id
:
id
,
name
:
name
}
return
res
.
status
(
200
).
json
(
response
)
})
//post api
app
.
post
(
'
/api/v1/test
'
,(
req
,
res
)
=>
{
const
email
=
req
.
body
.
email
const
password
=
req
.
body
.
password
//console.log(email,password)
if
(
!
email
||!
password
){
return
res
.
status
(
422
).
json
({
message
:
'
Email or Password is required
'
})
}
else
{
const
response
=
[
{
email
:
email
,
password
:
password
}
]
return
res
.
status
(
200
).
json
(
response
)
}
})
app
.
listen
(
PORT
,()
=>
{
console
.
log
(
'
server is listening
'
)
})
\ No newline at end of file
This diff is collapsed.
Click to expand it.
server.js
0 → 100644
+
0
−
0
View file @
599bec11
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment