Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DatabaseTest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Øivind Haugerøy Larsson
DatabaseTest
Commits
a4e1b899
Commit
a4e1b899
authored
6 years ago
by
Øivind Haugerøy Larsson
Browse files
Options
Downloads
Patches
Plain Diff
kjør2
parent
0dce86f2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#22821
passed
6 years ago
Stage: test
Stage: deploy
Changes
4
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
dao/persondao.js
+9
-2
9 additions, 2 deletions
dao/persondao.js
package-lock.json
+5286
-0
5286 additions, 0 deletions
package-lock.json
server.js
+8
-0
8 additions, 0 deletions
server.js
with
5304 additions
and
2 deletions
.gitignore
0 → 100644
+
1
−
0
View file @
a4e1b899
node_modules/
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dao/persondao.js
+
9
−
2
View file @
a4e1b899
...
...
@@ -22,7 +22,14 @@ module.exports = class PersonDao extends Dao {
);
}
updateOne
()
{
updateOne
(
id
,
json
,
callback
)
{
super
.
query
(
"
update person set navn=?, adresse=?, alder=? where id=?
"
,
[
json
.
navn
],
[
json
.
adresse
],
[
json
.
alder
],
[
id
],
callback
)
}
};
This diff is collapsed.
Click to expand it.
package-lock.json
0 → 100644
+
5286
−
0
View file @
a4e1b899
This diff is collapsed.
Click to expand it.
server.js
+
8
−
0
View file @
a4e1b899
...
...
@@ -41,4 +41,12 @@ app.post("/person", (req, res) => {
});
});
app
.
post
(
"
/person/:personId
"
,
(
req
,
res
)
=>
{
console
.
log
(
"
Fikk POST-request fra klient, update
"
);
personDao
.
updateOne
(
req
.
body
,
(
status
,
data
)
=>
{
res
.
status
(
status
);
res
.
json
(
data
);
})
})
var
server
=
app
.
listen
(
8080
);
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