File tree Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change 2
2
RED=' \033[0;31m'
3
3
GREEN=' \033[0;32m'
4
4
NC=' \033[0m'
5
+ BOLD=' \033[1m'
5
6
CHECK=" ${GREEN} \xE2\x9C\x93${NC} "
7
+ DEFAULT_MONGODB_URI=' mongodb://localhost:127.0.0.1:27017/parse'
8
+
6
9
confirm () {
7
10
DEFAULT=$1 ;
8
11
shift
@@ -89,12 +92,18 @@ read -r MASTER_KEY
89
92
90
93
[[ $MASTER_KEY = ' ' ]] && MASTER_KEY=$( genstring) && printf " \n$MASTER_KEY \n\n"
91
94
95
+ printf " Enter your mongodbURI (%s): " $DEFAULT_MONGODB_URI
96
+ read -r MONGODB_URI
97
+
98
+ [[ $MONGODB_URI = ' ' ]] && MONGODB_URI=" $DEFAULT_MONGODB_URI "
99
+
92
100
cat > ./config.json << EOF
93
101
{
94
102
"appId": "$APP_ID ",
95
103
"masterKey": "$MASTER_KEY ",
96
104
"appName": "$APP_NAME ",
97
- "cloud": "./cloud/main"
105
+ "cloud": "./cloud/main",
106
+ "mongodbURI": "$MONGODB_URI "
98
107
}
99
108
EOF
100
109
echo " ${CHECK} Created config.json"
@@ -142,8 +151,13 @@ echo "\n${CHECK} running npm install\n"
142
151
143
152
npm install
144
153
145
- confirm ' Y' ' \nDo you want to start the server now? (Y/n): '
146
-
147
- echo " \n${CHECK} running npm start\n"
154
+ CURL_CMD=$( cat << EOF
155
+ curl -X POST -H 'X-Parse-Application-Id: ${APP_ID} ' \\
156
+ -H 'Content-Type: application/json' \\
157
+ -d '{"foo":"bar"}' http://localhost:1337/parse/classes/TestObject
158
+ EOF)
148
159
149
- npm start
160
+ echo "\n${CHECK} Happy Parsing!\n\n"
161
+ echo "${CHECK} Make sure you have ${BOLD} mongo${NC} listening on ${BOLD}${MONGODB_URI}${NC} "
162
+ echo "${CHECK} start parse-server by running ${BOLD} npm start${NC} "
163
+ echo "${CHECK} Test your setup with:\n\n${CURL_CMD} \n"
You can’t perform that action at this time.
0 commit comments