Skip to content

Commit 9b543fd

Browse files
committed
Add a test page at index to check data insertion, fetch and cloud code example
* Add assets to compose the screen * Update express package version to properly serve the HTML
1 parent 4e59c80 commit 9b543fd

File tree

6 files changed

+497
-2
lines changed

6 files changed

+497
-2
lines changed

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
var express = require('express');
55
var ParseServer = require('parse-server').ParseServer;
6+
var path = require('path');
67

78
var databaseUri = process.env.DATABASE_URI || process.env.MONGOLAB_URI;
89

@@ -23,13 +24,16 @@ var api = new ParseServer({
2324

2425
var app = express();
2526

27+
// Config static middleware for assets
28+
app.use('/static', express.static(path.join(__dirname, '/public')));
29+
2630
// Serve the Parse API on the /parse URL prefix
2731
var mountPath = process.env.PARSE_MOUNT || '/parse';
2832
app.use(mountPath, api);
2933

3034
// Parse Server plays nicely with the rest of your web routes
3135
app.get('/', function(req, res) {
32-
res.status(200).send('I dream of being a web site.');
36+
res.sendFile(path.join(__dirname, '/public/index.html'));
3337
});
3438

3539
var port = process.env.PORT || 1337;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"license": "MIT",
1111
"dependencies": {
12-
"express": "~4.2.x",
12+
"express": "~4.11.x",
1313
"kerberos": "~0.0.x",
1414
"parse": "~1.6.12",
1515
"parse-server": "~2.1.2"

public/assets/css/style.css

Lines changed: 237 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,237 @@
1+
body {
2+
margin: 0;
3+
padding: 0;
4+
font-family: Helvetica, Arial, sans-serif;
5+
font-size: 14px;
6+
letter-spacing: 0.2px;
7+
line-height: 24px;
8+
color: #585858;
9+
}
10+
11+
a {
12+
color: #169CEE;
13+
text-decoration: underline;
14+
}
15+
16+
a:hover {
17+
color: #2C3D50;
18+
}
19+
20+
a:visited {
21+
color: #2a6496;
22+
}
23+
24+
25+
/*
26+
helpers
27+
*/
28+
29+
.align-center {
30+
text-align: center;
31+
}
32+
33+
.hidden {
34+
display: none;
35+
}
36+
37+
/*
38+
app css
39+
*/
40+
41+
.container {
42+
margin: 0 auto;
43+
margin-top: 45px;
44+
max-width: 860px;
45+
}
46+
47+
#parse-logo {
48+
width: 109px;
49+
height: 110px;
50+
margin: 0 0 20px;
51+
text-align: center;
52+
}
53+
54+
.up-and-running, .time-to-deploy {
55+
font-weight: bold;
56+
}
57+
58+
.advice {
59+
margin-bottom: 40px;
60+
}
61+
62+
.advice {
63+
background: #f4f4f4;
64+
border-radius: 4px;
65+
-webkit-border-radius: 4px 4px;
66+
-moz-border-radius: 4px 4px;
67+
-ms-border-radius: 4px 4px;
68+
-o-border-radius: 4px 4px;
69+
padding: 10px 20px;
70+
}
71+
72+
#parse-url {
73+
color: #169CEE;
74+
font-weight: bold;
75+
}
76+
77+
.step--container {
78+
margin: 30px 0 20px;
79+
border-top: 1px solid #E2E2E2;
80+
padding-top: 30px;
81+
}
82+
83+
/* Disabled step */
84+
.step--disabled .step--number {
85+
background: #fff;
86+
border-color: #B5B5B5;
87+
color: #B5B5B5;
88+
}
89+
90+
.step--disabled .step--info {
91+
border-color: #B5B5B5;
92+
color: #B5B5B5;
93+
}
94+
95+
.step--disabled .step--action-btn,
96+
.step--disabled .step--action-btn:hover {
97+
border-color: #B5B5B5;
98+
background: #fff;
99+
color: #B5B5B5;
100+
cursor: default;
101+
}
102+
103+
/* Disabled step eof */
104+
105+
.step--action-btn.success,
106+
.step--action-btn.success:hover {
107+
background: #57C689;
108+
border-color: #57C689;
109+
color: #fff;
110+
cursor: default;
111+
font-weight: bold;
112+
}
113+
114+
.step--number {
115+
background: #169CEE;
116+
border: 1px solid #169CEE;
117+
border-radius: 28px;
118+
-webkit-border-radius: 28px 28px;
119+
-moz-border-radius: 28px 28px;
120+
-ms-border-radius: 28px 28px;
121+
-o-border-radius: 28px 28px;
122+
display: block;
123+
margin: auto;
124+
width: 47px;
125+
height: 47px;
126+
font-weight: bolder;
127+
font-size: 20px;
128+
color: #FFFFFF;
129+
line-height: 47px; /* follows width and height */
130+
}
131+
132+
.step--info { }
133+
134+
.step--action-btn {
135+
color: #169CEE;
136+
font-size: 14px;
137+
font-weight: 100;
138+
border: 1px solid #169CEE;
139+
padding: 12px 18px;
140+
border-radius: 28px;
141+
-webkit-border-radius: 28px 28px;
142+
-moz-border-radius: 28px 28px;
143+
-ms-border-radius: 28px 28px;
144+
-o-border-radius: 28px 28px;
145+
cursor: pointer;
146+
text-decoration: none;
147+
display:inline-block;
148+
text-align: center;
149+
text-transform: uppercase;
150+
}
151+
152+
.step--action-btn:hover {
153+
background: #169CEE;
154+
color: white;
155+
}
156+
157+
.step--pre {
158+
margin-top: 4px;
159+
margin-bottom: 0;
160+
background: #f4f4f4;
161+
border-radius: 4px;
162+
-webkit-border-radius: 4px 4px;
163+
-moz-border-radius: 4px 4px;
164+
-ms-border-radius: 4px 4px;
165+
-o-border-radius: 4px 4px;
166+
padding: 10px 20px;
167+
word-wrap: break-word;
168+
font-size: 13px;
169+
}
170+
171+
#local-parse-working {
172+
font-size: 18px;
173+
line-height: 24px;
174+
color: #57C689;
175+
font-weight: bold;
176+
}
177+
178+
#step-4 .step--number {
179+
background: #57C689;
180+
border-color: #57C689;
181+
color: #fff;
182+
display: inline-block;
183+
}
184+
185+
.step--deploy-btn {
186+
display: block;
187+
margin-top: 20px;
188+
width: 170px;
189+
color: #57C689 !important;
190+
font-weight: bold;
191+
border-color: #57C689;
192+
}
193+
194+
.step--deploy-btn:hover {
195+
background: #57C689;
196+
color: #fff !important;
197+
}
198+
199+
#prod-test {
200+
margin-bottom: 60px;
201+
}
202+
203+
#prod-test input {
204+
background-color: #fff;
205+
border: 1px solid #B5B5B5;
206+
color: #000000;
207+
font-family: "Inconsolata";
208+
font-size: 16px;
209+
line-height: 17px;
210+
padding: 12px;
211+
width: 260px;
212+
border-radius: 4px;
213+
-webkit-border-radius: 4px 4px;
214+
-moz-border-radius: 4px 4px;
215+
-ms-border-radius: 4px 4px;
216+
-o-border-radius: 4px 4px;
217+
display:block;
218+
margin-bottom: 10px;
219+
}
220+
221+
#footer {
222+
border-top: 1px solid #E2E2E2;
223+
padding: 20px;
224+
}
225+
226+
#footer ul li {
227+
list-style-type: none;
228+
display:inline-block;
229+
}
230+
#footer ul li:after {
231+
content: "-";
232+
padding: 10px;
233+
}
234+
#footer ul li:last-child:after {
235+
content: "";
236+
}
237+

public/assets/images/parse-logo.png

5.16 KB
Loading

0 commit comments

Comments
 (0)