Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var app = require('express')();
- var http = require('http').Server(app);
- var io = require('socket.io')(http);
- app.get ('/', function(req, res){
- res.sendFile(__dirname + '/index.html');
- });
- http.listen(80, function(){
- console.log('listening on *:80');
- });
- <img src="img/myimage.png">
- myApp - folder
- index.js
- index.html
- img - folder
- myimage.png
- <img src="/img/myimage.png">
- <img src="./img/myimage.png">
- <img src="myimage.png">
- var app = require('express')();
- var express = require('express');
- var app = express();
- app.use(express.static(__dirname + '/img/'));
- const express = require("express");
- const app = express();
- app.use('/img', express.static(__dirname + '/Images'));
Add Comment
Please, Sign In to add comment