For example, I want to according to the user to access the secondary domain name, orientation to the corresponding directory:
app.use(express.static(path.join(__dirname, '/public')));
TO:
app.use(express.static(path.join(__dirname, '/'+domain+'/public')));
Let's say you have a file called "foo.png" in the folder [domain]/public.
Using app.use(express.static(path.join(__dirname, '/'+domain+'/public'))); will make that file available from http://localhost/foo.png for everyone. According to my understanding of your question it's not really what you want.
You should look for res.sendfile and do something like
app.get('/:username/:file', function(req, res){
res.sendfile(path.join(__dirname, req.params.username, req.params.file));
});
This way you can also add some security using a middleware to ensure that users can't access files of other users.
If you don't really mind for the security thing, you can simply add all the users' folders in the public folder (you can choose whatever name you want for that folder) and only use app.use(express.static(path.join(__dirname, '/public')));.
This way you can access the files with something like http://localhost/[username]/foo.png