# Done Timestamp app / quick notes / few questions

**URL:** <https://forum.freecodecamp.org/t/done-timestamp-app-quick-notes-few-questions/89679>\
**Category:** General\
**Created:** [February 21, 2017, 11:33am UTC](https://forum.freecodecamp.org/t/done-timestamp-app-quick-notes-few-questions/89679 "2017-02-21T11:33:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SpiritusSancti5](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/spiritussancti5/32/159582_2.png) [@SpiritusSancti5](https://forum.freecodecamp.org/u/SpiritusSancti5)\
**Post date:** [February 21, 2017, 11:33am UTC](https://forum.freecodecamp.org/t/done-timestamp-app-quick-notes-few-questions/89679/1 "2017-02-21T11:33:57Z")

</div>

So i just finished my timestamp app.

> **[GitHub - SpiritusSancti5/timestamp](https://github.com/SpiritusSancti5/timestamp)**
>
> Contribute to SpiritusSancti5/timestamp development by creating an account on GitHub.

Had some issues with cloud 9 / heroku.

Important things to keep in mind if you do your own:

- cloud9 only accepted 8080 port
- yes you can render html and don’t need to use ejs, i was stubborn and wanted to make it work instead of blindly following a guide
- some things can work perfectly fine locally or even on cloud 9, but they won’t work on heroku
- don’t forget the Procfile and capitalize the first letter, maybe this was stated in the previous guide, but i had a long break since then and forgot some of the important tiny key details
- yes you can have it all in one folder unstructured and yes /public whatever folder structure you use can make life easier, but it’s good to know how to do without it if you already know from a guide how to do it with that structure

Question :  
So i have the following code:

> app.use(“/”, express.static(\_\_dirname + ‘/’));

* * *

> app.get(‘/’, function(req, res){  
> res.sendFile(path.join(\_\_dirname+‘/index.html’));  
> });

Second function helps me render the html. But it won’t render the entire set of html + css if i use dirname + ‘/’ apparently. I guess it’s because there’s the server.js and other stuff in the same folder, but i am not sure …

Also adding another line in the second function:  
res.sendFile… just to add in the dirname + style.css breaks the app.  
Is there any way to use the second function to add in style.css / index.html?

First function seems to be capable to handle the html + css on its own making the second function useless here. Or so it appears on my cloud 9 account at the moment.

When and why do i use the second function. Or when is the second better than the first one?

One last question:  
I didn’t see any outstanding reason to use ejs instead of html. Someone please explain why ejs is recommended.

I still don’t like using jade, html looks safer and it’s harder to mess up your code. Is it all just preference based?

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 16, 2021, 2:48pm UTC](https://forum.freecodecamp.org/t/done-timestamp-app-quick-notes-few-questions/89679/2 "2021-01-16T14:48:15Z")

</div>

Closed on January 16, 2021, 2:48pm UTC


