-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.js
More file actions
35 lines (28 loc) · 1021 Bytes
/
index.js
File metadata and controls
35 lines (28 loc) · 1021 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var express = require("express"),
stormpath = require("express-stormpath"),
bodyParser = require("body-parser"),
mongoose = require("mongoose");
app = express();
console.log("HERE I AM!!!",process.env.STORMPATH_API_KEY_ID)
app.set("views", __dirname + "/views");
app.set("view engine", "ejs");
app.use(express.static(__dirname + "/public"));
app.use(stormpath.init(app, {
apiKeyFile: '/.stormpath/apiKey.properties',
apiKeyId: process.env.STORMPATH_API_KEY_ID || "key",
apiKeySecret: process.env.STORMPATH_API_KEY_SECRET || 'secret',
secretKey: process.env.STORMPATH_SECRET_KEY || "key",
application: process.env.STORMPATH_URL || "url",
}));
app.get("/", function(req, res) {
res.render("landing");
});
app.get("/newOrganization",stormpath.loginRequired, function(req, res) {
res.render("newOrganization");
});
// app.post("/newOrganiztation", function(req, res) {
// rep.send()
// })
app.listen(process.env.PORT || 3000, function() {
console.log("The CRM Server is running");
})