It uses hash-based routing, so URLs must be of the form http://foo.com/index.html#myPage. This approach means that even a statically hosted site with just the one real URL (index.html in this example) and zero server-side dynamicism can be a SPA with multiple virtual pages. All requests will ultimately come to index.html and then the router takes over and shows the right actual page based on the hash in the URL. Back and forward buttons work, as does page refresh, bookmarking, emailing links etc.
The code is on GitHub, with a decent README explaining the features and the key files to look at, so I won’t repeat that here. The code is also well-commented, with the intention that you can (and should) read it to see how it works. You can clone it, then simply double click src/index.html to open it in your browser and see its capabilities demonstrated. Nice and easy.
Any feedback is very much appreciated. I imagine there are other similar routers out there, but this one is mine and making it (and using it in anger) taught me a lot and provided a nice, tight result which I can easily add to as required.
On a welcome break from studying for my GCSEs at school I spent two weeks doing ‘work experience’ at LShift. At the end of the two week placement I was interrogated by Keith Fisher. Here’s a transcript:
Yes I had complete control over what I wanted to do for my work experience. If I didn’t, I would be working in an old people’s home or a school. Also, I think if you don’t find a work placement before the deadline, you have to work for a teacher.
I picked LShift because it seemed like a fun place to work, LShift also works with software development which is something that I am doing at school and it’s something I enjoy. A relative suggested LShift as a place to do my work experience so I did some research. The website really said it all, software design, computers and free cola. That was all I needed.
When I arrived, I was actually surprised. I was imagining the place to be a huge company with hundreds of employees. Instead it was quite a small sized company with friendly people! LShift must be an anomaly in the industry. It’s a place where stress isn’t even a problem, everyone is relaxed and calm. It was actually relaxing to be there.
While I worked at LShift I had the chance to sit in on a training course for a project management method called “DSDM” which will help me in later life. I learnt how to make programs using .net. I learnt how software development companies run and work. Lastly, I learnt what it’s like to work for a fantastic company.
No, I could learn so much more from LShift so leaving so quickly is a shame.
No I would never come here again… just kidding. I would definitely consider working at LShift again. In the future I would hope I could work somewhere like this.
You are currently browsing the LShift Ltd. blog archives for April, 2014.