/*
Terminal Commands:
npm init
npm install express
*/
//index.js commands:
const express= require('express');
const app= express();
app.use(express.static(__dirname)); //server css file as static otherwise css won't be seen in index.html when sent through sendFile()
//handling get request for home route
app.get("/",function(req,res){
res.sendFile(__dirname+"index.html");
});
//handling post request for home route
app.post("/",function(req,res){
res.send("Post request Recieved!");
});
//makes the server to reserve port 3000 for this application
app.listen("3000",function(){
console.log("Server running on port 3000");
});
$ npm i vue vuex vue-loader css-loader vue-template-compiler node-sass sass-loader postcss-loader postcss-loader webpack-node-externals webpack-merge webpack babel-core babel-loader babel-plugin-transform-object-rest-spread babel-preset-env --save
/*
Terminal Commands:
npm init
npm install express
*/
//index.js commands:
const express= require('express');
const app= express();
app.use(express.static(__dirname)); //server css file as static otherwise css won't be seen in index.html when sent through sendFile()
//handling get request for home route
app.get("/",function(req,res){
res.sendFile(__dirname+"index.html");
});
//handling post request for home route
app.post("/",function(req,res){
res.send("Post request Recieved!");
});
//makes the server to reserve port 3000 for this application
app.listen("3000",function(){
console.log("Server running on port 3000");
});
$ npm i vue vuex vue-loader css-loader vue-template-compiler node-sass sass-loader postcss-loader postcss-loader webpack-node-externals webpack-merge webpack babel-core babel-loader babel-plugin-transform-object-rest-spread babel-preset-env --save