I am beginner to node.js. Can someone help me for run framework7 with node.js
var express = require('express');
var app = express();
var path = require('path');
app.get('/', function (req, res) {
res.sendFile(path.join(__dirname + '/index.html'));
});
var server = app.listen(8080, function () {
console.log('Server is running..');
});
Hi uslualper,
What are you trying to accomplish ? In other words, why do you need node.js for ?
Depending on your goals you have a different paths to go.
1 Like
I found the solution.
var express = require('express');// express.js
var app = express();
var path = require('path');
app.use('/app', express.static(__dirname + '/app')); //Run Framework7 app
app.get('/', function (req, res) {
res.sendFile(path.join(__dirname + '/app/index.html'));
});
var routes = require('./scripts/routes'); //RESTful APIs
routes(app);
app.listen(8080);
console.log('-> Port : 8080');
como conseguiu? pode me ajudar poste o conteudo scripts/routes?
Meu problema foi resolvido dessa forma:
var express = require(‘express’);
const path = require(‘path’);
const bodyParser = require(‘body-parser’);
var app = express();
app.use(bodyParser.json());
app.use(express.static(__dirname + ‘/www’));
app.listen(8080,function(){
console.log(“Servidor ativo no porto 8080”);
});