Skip to content

Commit 62c8282

Browse files
committed
Merge pull request #92 from run-project/feature/test-screen
Add a page to assist users to test the parse server
2 parents f0aecc3 + b7cd112 commit 62c8282

File tree

7 files changed

+504
-3
lines changed

7 files changed

+504
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ A detailed tutorial is available here:
8787

8888
# Using it
8989

90-
You can use the REST API, the JavaScript SDK, and any of our open-source SDKs:
90+
Before using it, you can access a test page to verify if the basic setup is working fine [http://localhost:1337/test](http://localhost:1337/test).
91+
Then you can use the REST API, the JavaScript SDK, and any of our open-source SDKs:
9192

9293
Example request to a server running locally:
9394

index.js

Lines changed: 8 additions & 0 deletions
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,6 +24,9 @@ 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);
@@ -32,6 +36,10 @@ app.get('/', function(req, res) {
3236
res.status(200).send('I dream of being a web site.');
3337
});
3438

39+
app.get('/test', function(req, res) {
40+
res.sendFile(path.join(__dirname, '/public/test.html'));
41+
});
42+
3543
var port = process.env.PORT || 1337;
3644
app.listen(port, function() {
3745
console.log('parse-server-example running on port ' + port + '.');

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "parse-server-example",
3-
"version": "1.2.0",
3+
"version": "1.3.0",
44
"description": "An example Parse API server using the parse-server module",
55
"main": "index.js",
66
"repository": {
@@ -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.4"

public/assets/css/style.css

Lines changed: 238 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,238 @@
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+
white-space: inherit;
169+
font-size: 13px;
170+
}
171+
172+
#local-parse-working {
173+
font-size: 18px;
174+
line-height: 24px;
175+
color: #57C689;
176+
font-weight: bold;
177+
}
178+
179+
#step-4 .step--number {
180+
background: #57C689;
181+
border-color: #57C689;
182+
color: #fff;
183+
display: inline-block;
184+
}
185+
186+
.step--deploy-btn {
187+
display: block;
188+
margin-top: 20px;
189+
width: 170px;
190+
color: #57C689 !important;
191+
font-weight: bold;
192+
border-color: #57C689;
193+
}
194+
195+
.step--deploy-btn:hover {
196+
background: #57C689;
197+
color: #fff !important;
198+
}
199+
200+
#prod-test {
201+
margin-bottom: 60px;
202+
}
203+
204+
#prod-test input {
205+
background-color: #fff;
206+
border: 1px solid #B5B5B5;
207+
color: #000000;
208+
font-family: "Inconsolata";
209+
font-size: 16px;
210+
line-height: 17px;
211+
padding: 12px;
212+
width: 260px;
213+
border-radius: 4px;
214+
-webkit-border-radius: 4px 4px;
215+
-moz-border-radius: 4px 4px;
216+
-ms-border-radius: 4px 4px;
217+
-o-border-radius: 4px 4px;
218+
display:block;
219+
margin-bottom: 10px;
220+
}
221+
222+
#footer {
223+
border-top: 1px solid #E2E2E2;
224+
padding: 20px;
225+
}
226+
227+
#footer ul li {
228+
list-style-type: none;
229+
display:inline-block;
230+
}
231+
#footer ul li:after {
232+
content: "-";
233+
padding: 10px;
234+
}
235+
#footer ul li:last-child:after {
236+
content: "";
237+
}
238+

public/assets/images/parse-logo.png

5.16 KB
Loading

0 commit comments

Comments
 (0)