A
A
Alexander Knyazev2017-02-01 10:11:03
HTML
Alexander Knyazev, 2017-02-01 10:11:03

How to create a node server that responds to a '/' site based on bootstrap-template?

I downloaded a ready -made one-page site template from the startbootstrap.com site, redesigned it to fit my needs. It is launched using browsersync and gulp. (browsersync.create() is included in the gulpfile.js file). Now I need to put this whole thing on a server, preferably on Express.js. What should be my actions?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2017-02-01
@alexandrknyazev13071995

What should be my actions?

Go read the documentation and stumble upon a lovely example:
var path = require('path');
var express = require('express');
var app = express();

app.use(express.static(path.join(__dirname, './public'))); // если сайт лежит в папке public в корне проекта

app.listen(3000, function () {
  console.log('Example app listening on port 3000!');
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question