Timestamp Microservice finished

Finished my first backend project: https://fcc-vj-timestamp.herokuapp.com/

Basically hacked together some kind of Frankenstein’s monster, but it works.

Also this is the first project where I added tests (used mocha) - it really helps to be able to check your code at any time while coding and be sure that all previous functions still work.

1 Like

It is fully functional and well made.One thing i would like to point out though while entering a date in its natural format i tried a few combinations,i figured for months you have done a pattern matching of kind where suppose for the month of March if i enter “Mar/mar” it considers it as valid input and displays the appropriate result but if i enter anything after matching your desired pattern as in “Mardhsfjldsljfdslfj”(excluding numbers) it considers it as valid input as it matches the pattern you desired i.e “mar” and if i append anything after it still considers it as a valid input.May be you could try to handle that in some way to make it more robust otherwise it works extremely well.

1 Like

Yes, there is a pattern matching - only first three letters are considered (enough to identify the month). It was made by design as a simple error correction, so user can input septrmber and still get the answer.

But now that I’m thinking about it after your comment, the user should supply valid data if he wants to use the API.

Changed the API so it now accepts only full months or three letter version.

P.S. Having test cases was veeeeery helpful.

1 Like

Actually i would have done the same if i was in your place but there’s so much a developer can do sometimes a user have to do their part as well.:smiley:

I was also thinking of setting up a TDD for my next project,up until now i was putting it off for various reasons but i am definitely going to do so in my next assignment.

@jenovs, this looks great!

For both of you (@kunalgupta05 included!)–I’ve done some testing before…and by some I mean, I’ve done things that have given me test specs (so far all with Jasmine) and I write code from scratch to make them pass. I’ve been wanting to get into writing my own tests for projects, and I’m about to embark on the back-end challenges, so I figured it might be a good time to do both. :slight_smile: But considering I’ve only seen test specs for more code-challenge-type things (vs. actual apps), I’m having trouble figuring out where/how to start.

Any tips? Or examples that you’re fond of (or that you’ve written, or both!) that I could go off of? Or resources for those new to writing tests? Or anything, really? :grin: