Commit 2ea847ae8e2e4c7f3b5231b44b458b560c9a04a0

Authored by kristinlaahneolsen
1 parent 7d5a5a40

suksessfull post fra app

restApi/.idea/workspace.xml
... ... @@ -2,7 +2,13 @@
2 2 <project version="4">
3 3 <component name="ChangeListManager">
4 4 <list default="true" id="0e20d303-9de8-4113-bfd9-019e72b304dc" name="Default" comment="">
  5 + <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/java/activity/Evaluations.java" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/java/activity/Evaluations.java" />
  6 + <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/java/activity/NewEvaluation.java" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/java/activity/NewEvaluation.java" />
  7 + <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/java/api/Endpoints.java" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/java/api/Endpoints.java" />
  8 + <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/java/database/DatabaseSource.java" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/java/database/DatabaseSource.java" />
  9 + <change beforePath="$PROJECT_DIR$/../Risiko/app/src/main/java/dataclasses/Evaluation.java" afterPath="$PROJECT_DIR$/../Risiko/app/src/main/java/dataclasses/Evaluation.java" />
5 10 <change beforePath="$PROJECT_DIR$/api/routes/routes.js" afterPath="$PROJECT_DIR$/api/routes/routes.js" />
  11 + <change beforePath="$PROJECT_DIR$/package.json" afterPath="$PROJECT_DIR$/package.json" />
6 12 </list>
7 13 <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
8 14 <option name="TRACKING_ENABLED" value="true" />
... ... @@ -12,12 +18,22 @@
12 18 <option name="LAST_RESOLUTION" value="IGNORE" />
13 19 </component>
14 20 <component name="FileEditorManager">
15   - <leaf>
  21 + <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
16 22 <file leaf-file-name="routes.js" pinned="false" current-in-tab="true">
17 23 <entry file="file://$PROJECT_DIR$/api/routes/routes.js">
18 24 <provider selected="true" editor-type-id="text-editor">
19   - <state relative-caret-position="385">
20   - <caret line="179" column="83" lean-forward="false" selection-start-line="179" selection-start-column="83" selection-end-line="179" selection-end-column="83" />
  25 + <state relative-caret-position="180">
  26 + <caret line="182" column="16" lean-forward="false" selection-start-line="182" selection-start-column="16" selection-end-line="182" selection-end-column="16" />
  27 + <folding />
  28 + </state>
  29 + </provider>
  30 + </entry>
  31 + </file>
  32 + <file leaf-file-name="package.json" pinned="false" current-in-tab="false">
  33 + <entry file="file://$PROJECT_DIR$/package.json">
  34 + <provider selected="true" editor-type-id="text-editor">
  35 + <state relative-caret-position="120">
  36 + <caret line="8" column="38" lean-forward="false" selection-start-line="8" selection-start-column="38" selection-end-line="8" selection-end-column="38" />
21 37 <folding />
22 38 </state>
23 39 </provider>
... ... @@ -42,6 +58,7 @@
42 58 <option name="CHANGED_PATHS">
43 59 <list>
44 60 <option value="$PROJECT_DIR$/api/routes/routes.js" />
  61 + <option value="$PROJECT_DIR$/package.json" />
45 62 </list>
46 63 </option>
47 64 </component>
... ... @@ -77,6 +94,7 @@
77 94 <foldersAlwaysOnTop value="true" />
78 95 </navigator>
79 96 <panes>
  97 + <pane id="Scratches" />
80 98 <pane id="ProjectPane">
81 99 <subPane>
82 100 <expand>
... ... @@ -106,7 +124,6 @@
106 124 </subPane>
107 125 </pane>
108 126 <pane id="Scope" />
109   - <pane id="Scratches" />
110 127 </panes>
111 128 </component>
112 129 <component name="PropertiesComponent">
... ... @@ -124,6 +141,39 @@
124 141 </list>
125 142 </option>
126 143 </component>
  144 + <component name="RunManager" selected="npm.debug">
  145 + <configuration name="server.js" type="NodeJSConfigurationType" factoryName="Node.js" temporary="true" path-to-js-file="server.js" working-dir="$PROJECT_DIR$" />
  146 + <configuration name="api" type="js.build_tools.npm" factoryName="npm" temporary="true" nameIsGenerated="true">
  147 + <package-json value="$PROJECT_DIR$/package.json" />
  148 + <command value="run" />
  149 + <scripts>
  150 + <script value="api" />
  151 + </scripts>
  152 + <node-interpreter value="project" />
  153 + <envs />
  154 + </configuration>
  155 + <configuration name="debug" type="js.build_tools.npm" factoryName="npm" temporary="true" nameIsGenerated="true">
  156 + <package-json value="$PROJECT_DIR$/package.json" />
  157 + <command value="run" />
  158 + <scripts>
  159 + <script value="debug" />
  160 + </scripts>
  161 + <node-interpreter value="project" />
  162 + <envs />
  163 + </configuration>
  164 + <list size="3">
  165 + <item index="0" class="java.lang.String" itemvalue="Node.js.server.js" />
  166 + <item index="1" class="java.lang.String" itemvalue="npm.api" />
  167 + <item index="2" class="java.lang.String" itemvalue="npm.debug" />
  168 + </list>
  169 + <recent_temporary>
  170 + <list size="3">
  171 + <item index="0" class="java.lang.String" itemvalue="npm.debug" />
  172 + <item index="1" class="java.lang.String" itemvalue="npm.api" />
  173 + <item index="2" class="java.lang.String" itemvalue="Node.js.server.js" />
  174 + </list>
  175 + </recent_temporary>
  176 + </component>
127 177 <component name="ShelveChangesManager" show_recycled="false">
128 178 <option name="remove_strategy" value="false" />
129 179 </component>
... ... @@ -139,27 +189,28 @@
139 189 <updated>1541088603899</updated>
140 190 <workItem from="1541088608198" duration="134000" />
141 191 <workItem from="1541088784358" duration="1764000" />
  192 + <workItem from="1541155443683" duration="818000" />
142 193 </task>
143 194 <servers />
144 195 </component>
145 196 <component name="TimeTrackingManager">
146   - <option name="totallyTimeSpent" value="1898000" />
  197 + <option name="totallyTimeSpent" value="2716000" />
147 198 </component>
148 199 <component name="ToolWindowManager">
149 200 <frame x="0" y="0" width="1440" height="900" extended-state="0" />
150 201 <editor active="true" />
151 202 <layout>
152   - <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24947146" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
  203 + <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24947146" sideWeight="0.49369368" order="0" side_tool="false" content_ui="combo" />
153 204 <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
154 205 <window_info id="Docker" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
155 206 <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
156 207 <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
157   - <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
158   - <window_info id="npm" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
  208 + <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32889965" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
  209 + <window_info id="npm" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24947146" sideWeight="0.5063063" order="2" side_tool="true" content_ui="tabs" />
159 210 <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
160 211 <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
161 212 <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
162   - <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
  213 + <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.39903265" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
163 214 <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
164 215 <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
165 216 <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
... ... @@ -176,10 +227,47 @@
176 227 <option name="myLimit" value="2678400000" />
177 228 </component>
178 229 <component name="XDebuggerManager">
179   - <breakpoint-manager />
  230 + <breakpoint-manager>
  231 + <breakpoints>
  232 + <line-breakpoint enabled="true" type="javascript">
  233 + <url>file://$PROJECT_DIR$/api/routes/routes.js</url>
  234 + <line>171</line>
  235 + <properties lambdaOrdinal="-1" />
  236 + </line-breakpoint>
  237 + <line-breakpoint enabled="true" type="javascript">
  238 + <url>file://$PROJECT_DIR$/api/routes/routes.js</url>
  239 + <line>170</line>
  240 + <properties lambdaOrdinal="-1" />
  241 + <option name="timeStamp" value="1" />
  242 + </line-breakpoint>
  243 + <line-breakpoint enabled="true" type="javascript">
  244 + <url>file://$PROJECT_DIR$/api/routes/routes.js</url>
  245 + <line>182</line>
  246 + <properties lambdaOrdinal="-1" />
  247 + <option name="timeStamp" value="2" />
  248 + </line-breakpoint>
  249 + </breakpoints>
  250 + <option name="time" value="3" />
  251 + </breakpoint-manager>
180 252 <watches-manager />
181 253 </component>
182 254 <component name="editorHistoryManager">
  255 + <entry file="file://$PROJECT_DIR$/api/routes/routes.js">
  256 + <provider selected="true" editor-type-id="text-editor">
  257 + <state relative-caret-position="0">
  258 + <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
  259 + <folding />
  260 + </state>
  261 + </provider>
  262 + </entry>
  263 + <entry file="file://$PROJECT_DIR$/api/modules/evaluation.js">
  264 + <provider selected="true" editor-type-id="text-editor">
  265 + <state relative-caret-position="0">
  266 + <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
  267 + <folding />
  268 + </state>
  269 + </provider>
  270 + </entry>
183 271 <entry file="file://$PROJECT_DIR$/api/modules/evaluation.js">
184 272 <provider selected="true" editor-type-id="text-editor">
185 273 <state relative-caret-position="0">
... ... @@ -188,10 +276,18 @@
188 276 </state>
189 277 </provider>
190 278 </entry>
  279 + <entry file="file://$PROJECT_DIR$/package.json">
  280 + <provider selected="true" editor-type-id="text-editor">
  281 + <state relative-caret-position="120">
  282 + <caret line="8" column="38" lean-forward="false" selection-start-line="8" selection-start-column="38" selection-end-line="8" selection-end-column="38" />
  283 + <folding />
  284 + </state>
  285 + </provider>
  286 + </entry>
191 287 <entry file="file://$PROJECT_DIR$/api/routes/routes.js">
192 288 <provider selected="true" editor-type-id="text-editor">
193   - <state relative-caret-position="385">
194   - <caret line="179" column="83" lean-forward="false" selection-start-line="179" selection-start-column="83" selection-end-line="179" selection-end-column="83" />
  289 + <state relative-caret-position="180">
  290 + <caret line="182" column="16" lean-forward="false" selection-start-line="182" selection-start-column="16" selection-end-line="182" selection-end-column="16" />
195 291 <folding />
196 292 </state>
197 293 </provider>
... ...
restApi/api/routes/routes.js
... ... @@ -168,6 +168,7 @@ var appRouter = function(app) {
168 168 * Add a new evaluation
169 169 */
170 170 app.post("/evaluation", function(req, res) {
  171 + console.log("hello?")
171 172 if(!req.body.id || !req.body.title || !req.body.outcome || !req.body.measures || !req.body.consequence || !req.body.probability || !req.body.associatedActivity) {
172 173 return res.status(400).send("Missing params");
173 174 } else {
... ...
restApi/package.json
... ... @@ -5,7 +5,8 @@
5 5 "main": "index.js",
6 6 "scripts": {
7 7 "test": "echo \"Error: no test specified\" && exit 1",
8   - "api": "nodemon server.js"
  8 + "api": "nodemon server.js",
  9 + "debug": "node $NODE_DEBUG_OPTION server.js"
9 10 },
10 11 "keywords": [
11 12 "RESTful"
... ...