serve build node npm
// create directory
//npm init -y
//npm i express --save
//create public directory
//create server.js
// <---- In the server js file --->
'use strict';
const express = require('express');
const app = express();
app.use(express.static('public'));// to connect with frontend html
app.use(express.json());//body parse
app.get('/', function(req,res){
res.send('This is the Homepage');
//res.sendFile('index.html');
});
app.listen(3000);
# in terminal cd to project root dir
# to build project:
npm run build
# to serve/host project locally:
serve -s ./build
Also in C++:
- print in bash
- install tar.xz in ubuntu
- Python plot graph in bash
- awk or statement
- install tweepy
- bash list process on port
- conda install pandas
- centos install specific kernel headers
- git set head to commit
- ubuntu switch f1 with functions keys
- composer require laravel/ui app.css empty
- ubuntu delete directory and all files
- ftp command in linux
- remove iptables rule
- lines of code
- sed range of lines result
- git setup local user
- crontab is not running my shell script
- how to run heroku scrapy file from terminal
- bash jump to
- how to become root user in ubuntu
- ubuntu lemp
- how to install packages from jupyter notebook
- Sync your Git Fork to the Original Repo