Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial for contest: Swift, Perfect, mustache and PostgreSQL on Heroku #162

Closed
abjurato opened this issue May 2, 2016 · 7 comments
Closed

Comments

@abjurato
Copy link

abjurato commented May 2, 2016

As every iOS developer, sometimes I feel that for a new app I’d better have a back-end: some simple server that will store data and pass it to client on iOS in some specific shape. Since Swift became open source, laziness no longer has excuse.
In this series of tutorials back-end for imagnery iOS app is created. It is deployed to cloud, stores data in PostgreSQL database and responds with JSON with this data. Structure of responses is defined by mustache templates.

Chapter 1 — make Perfect respond with mustache
Chapter 2 — connect PostgreSQL database, respond with data stored in db
Chapter 3 — deploy to Heroku
Chapter 4 — the final one, make PostgreSQL work on Heroku

Code on github for all chapters: CatFoodServer

If you've noticed any mistake, please let me know, in order to prevent somebody from breaking his keyboard like I did investigating mysterious web development universe 🍻

@whatisinternet
Copy link

@abjurato Thanks for the tutorial! I found one small issue In chapter 1 the mustache template specifies quotes around the responder name. The quotes will cause an error that could be difficult to debug. The code in the sample repo is correct.


Correct code from your example

@abjurato
Copy link
Author

abjurato commented May 3, 2016

@whatisinternet oh, my bad, sorry. Fixed, and thanks a lot!

@ShaneQi
Copy link
Contributor

ShaneQi commented May 5, 2016

Thank you for the tutorial, appreciate it!

In my understanding, you are using mustache to respond json.

Have you tried encode dictionary to json string and then respond the json string directly?

Because when I tried to encode and respond, I encounter some obstacles.

@abjurato
Copy link
Author

abjurato commented May 5, 2016

@qizt I've decided that for my purposes mustache will be more comfortable, but using JSONEncoder should not behave with Perfect in any specific way

@PoojaDevelopler
Copy link

hy i have tried to deploy my perfect code with heroku but stuck on one point :-
Perfect app detected
~/tmp/buildpacks/f64672f7b558b31ff8bb0f11a8cefa0793e1005f06dd4323b83cab5c5367d668c8be836b886f101ceac34923feac6fd52bf2ccc3c8143ad8f3204e69d17d2399 ~/tmp/buildpacks/f64672f7b558b31ff8bb0f11a8cefa0793e1005f06dd4323b83cab5c5367d668c8be836b886f101ceac34923feac6fd52bf2ccc3c8143ad8f3204e69d17d2399
-----> Checking stack
Build failure: Sorry, only Ubuntu 14.04 is currently supported
-----> Log
~/tmp/buildpacks/f64672f7b558b31ff8bb0f11a8cefa0793e1005f06dd4323b83cab5c5367d668c8be836b886f101ceac34923feac6fd52bf2ccc3c8143ad8f3204e69d17d2399
cat: /build.log: No such file or directory
! Push rejected, failed to compile Perfect app.
! Push failed

@abjurato
Copy link
Author

hy i have tried to deploy my perfect code with heroku but stuck on one point :- ...

@Aishly almost 2 years passed since this tutorial was published, Perfect changed a lot and I haven’t touched new versions, so not sure I can help much.

Your problem is: Perfect app can not be compiled on Heroku’s machine. Try looking in that direction, cuz error message says “only Ubuntu 14.04 is supported” - but what is Ubuntu version on your Heroku?

@PoojaDevelopler
Copy link

PoojaDevelopler commented Jun 30, 2018

i have solved most of the things but now stuck on new issue Fetching dependencies
remote: Build failure: Fetching cedar14-clang-v2.tar.gz
remote: -----> Log
remote: ~/tmp/buildpacks/4ebc226deddc6665d9f57c8f21c0ac38cbad3826f7362483dd4f4ba0ee5b07c9975e5cbc9c329c8e90b4f20469ef089c26293edab4406238a463c4996ee5d540
remote: ! Push rejected, failed to compile Perfect app.

https://firebasestorage.googleapis.com/v0/b/raimagetest.appspot.com/o/Screen%20Shot%202018-06-30%20at%205.26.26%20PM.png?alt=media&token=1042e6b6-4b4c-4e0f-8f26-f61d95e411f1

https://firebasestorage.googleapis.com/v0/b/raimagetest.appspot.com/o/Screen%20Shot%202018-06-30%20at%205.28.56%20PM.png?alt=media&token=3655aa22-2f95-4b03-9b09-c7b30cdd989e

https://firebasestorage.googleapis.com/v0/b/raimagetest.appspot.com/o/Screen%20Shot%202018-06-30%20at%205.29.09%20PM.png?alt=media&token=01412910-e7fb-4c80-8272-c216cb46b5d8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants