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
23d79e99
Commit
23d79e99
authored
Jul 4, 2023
by
Sandeep Jha
Browse files
Options
Downloads
Patches
Plain Diff
second commit
parent
389ea971
No related branches found
No related tags found
No related merge requests found
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
app.js
+37
-0
37 additions, 0 deletions
app.js
package-lock.json
+600
-0
600 additions, 0 deletions
package-lock.json
package.json
+5
-0
5 additions, 0 deletions
package.json
with
643 additions
and
0 deletions
.gitignore
0 → 100644
+
1
−
0
View file @
23d79e99
/node_modules
\ No newline at end of file
This diff is collapsed.
Click to expand it.
app.js
0 → 100644
+
37
−
0
View file @
23d79e99
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.
package-lock.json
0 → 100644
+
600
−
0
View file @
23d79e99
This diff is collapsed.
Click to expand it.
package.json
0 → 100644
+
5
−
0
View file @
23d79e99
{
"dependencies"
:
{
"
express
"
:
"
^4.18.2
"
}
}
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
sign in
to comment