Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
todo-application
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor 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
devops-project
todo-application
Commits
7d2dd163
Commit
7d2dd163
authored
4 years ago
by
Lucendio
Browse files
Options
Downloads
Patches
Plain Diff
Introduce /env endpoint & elaborate one the purpose of the Makefile
parent
4738f31a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+9
-7
9 additions, 7 deletions
README.md
app/server/src/index.js
+5
-0
5 additions, 0 deletions
app/server/src/index.js
app/server/src/routes/env.js
+10
-0
10 additions, 0 deletions
app/server/src/routes/env.js
with
24 additions
and
7 deletions
README.md
+
9
−
7
View file @
7d2dd163
...
...
@@ -8,16 +8,18 @@ This repository contains the [application](./app/README.md) that should be used
### Getting started
For more information regarding the app, please
hav
e a look into its
[
README
](
./app/README.md
)
.
For more information regarding the app, please
tak
e a look into its
[
README
](
./app/README.md
)
.
The
`Makefile`
is the main entry point for this repository. It's meant to be used for documentation purposes and local
development/invocation only. The following commands are available:
The
`Makefile`
is the main entry point for this repository. It's meant to locally play and mess around with the
application to figure out how it works and to tear it apart if necessary. Additionally, it should document all
invocations relevant to help you adapt this application as
*workload*
for the exercise implementation.
*NOTE:*
**
_Please note, that this
`Makefile`
is solely meant to showcase how to interact with the application and the code base.
It is not recommended to invoke
`make`
targets from the CI/CD, but rather use automation-specific interfaces
(e.g.
`Jenkinsfile`
,
`.travis.yml`
, etc.), which would then invoke commands shown under some make target or in on eof the
`package.json`
files._
**
The
`Makefile`
is solely meant to showcase how to interact with the application and the code base, it is not recommended
to invoke make targets from the CI/CD, but rather use automation-specific interfaces (e.g.
`Jenkinsfile`
,
`.travis.yml`
,
etc.), which would then invoke logic also shown under some make target.
The following commands are available:
#### `make install-stack`
...
...
This diff is collapsed.
Click to expand it.
app/server/src/index.js
+
5
−
0
View file @
7d2dd163
...
...
@@ -7,6 +7,7 @@ const dbClientInstance_ = require('./db/mongo.js');
const
todoRoutes
=
require
(
'
./routes/todo
'
);
const
userRoutes
=
require
(
'
./routes/user
'
);
const
errorRoutes
=
require
(
'
./routes/error
'
);
const
envRoute
=
require
(
'
./routes/env.js
'
);
let
cookieParser
=
require
(
'
cookie-parser
'
);
const
app
=
express
();
...
...
@@ -34,6 +35,10 @@ app.use(helmet.contentSecurityPolicy({
app
.
use
(
todoRoutes
);
app
.
use
(
userRoutes
);
app
.
use
(
'
/
'
,
express
.
static
(
path
.
resolve
(
__dirname
,
`./public`
)));
// IMPORTANT: Educational purpose only! Possibly exposes sensitive data.
app
.
use
(
envRoute
);
// NOTE: must be last one, because is uses a wildcard (!) that behaves aa
// fallback and catches everything else
app
.
use
(
errorRoutes
);
...
...
This diff is collapsed.
Click to expand it.
app/server/src/routes/env.js
0 → 100644
+
10
−
0
View file @
7d2dd163
const
express
=
require
(
'
express
'
);
const
routes
=
express
.
Router
();
routes
.
get
(
'
/env
'
,
(
req
,
res
)
=>
{
res
.
send
(
process
.
env
);
});
module
.
exports
=
routes
;
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