17 private links
app.get('/:var(bla|blabla)?', todo)
:var
sets the req.param
that you don't use. it's only used in this case to set the regex.
(bla|blabla)
sets the regex to match, so it matches the strings bla
and blablah
.
?
makes the entire regex optional, so it matches /
as well.
The protocol is available as req.protocol. docs here
var fullUrl = req.protocol + '://' + req.get('host') + req.originalUrl;
By using above example, you can get full page URL.
One of the biggest obstacles for adoption of Angular in the enterprise is technical, but not of the nature that one could expect.
It's hard to convince our boss to use Angular in our next project if we can't even install it in our own PC ;-) ! We would probably want to do an early demo or prototype to get things started.
But many companies have corporate proxies and security policies that make tools like npm hard to try out for the first time.
One of the biggest features of AngularJs is that it does not come necessarily with all the tooling ecosystem, and can be used via simple script tags. Angular 2 and beyond in principle can also, but we really want to use it together with Typescript, the Angular CLI, Webpack and all the tooling ecosystem.
Using Simple Examples
In any substantial project, it is necessary to separate your code in different files. Node.js implements the CommonJS API standard to load modules from other files. Using exports can be a source of much confusion in Node.js. Let us explore how exports works.
Instead of return
, you should use callbacks
as in asynchronous
operations, return
does not wait for the I/O
operation to complete.
<VirtualHost example.com:*>
ProxyPreserveHost On
ProxyPass /api http://localhost:3000/
ProxyPassReverse /api http://localhost:3000/
ServerName localhost
</VirtualHost>
Nowadays, more and more websites support two or more languages. More languages supporting simply means more customers your website would. i18n (internationalization) is a solution to localize a web application into different languages and cultures, this is not simple process especially you have a large web application.
However, if you are using nodejs, thanks to many open-source i18n node middleware, you can deploy i18n solution without too much pain. This blog provides a simple demo to show how to build a multi-language website by using node and its i18n module.