nodejs css text html,Using Nodejs to render html-css-javascript-images

I'm exploring and testing nodejs with a html, css and javascript.

When i run index.html locally (no webserver) I can see the css,js,html,images render properly on my browser.

The problem when I create server.js and browse localhost:8000/index.html, it just return my heading and paragraph... no nice images, css, js execute...

I have gone through from SO and due to calling is only on html file but not css/js/images.

I don't know what's the problem, and how to proceed further.

This is my server.js:

var express = require('express');

var connect = require('connect');

var http = require('http');

var path = "";

var app = connect().use(express.static(__dirname + path));

http.createServer(app).listen(8000);

This is my index.html:

TEST NODEJS WEB

My First Heading

My first paragraph.

This is folder structure in my machine:

home

xero

next

js/next.min.js

css/next.min.css

myweb

index.html

topology_data.js

action-panel.js

topology.js

main.js

server.js

When i browse index.html..only can see 'My First Heading' and 'My first paragraph.'

Please help and advise me further. Thank you.

Thanks to all

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值