node.js 初级配置

const express = require('express')
const path = require('path')
const app = express()

app.use(express.static(path.join(__dirname, 'public')))//存放静态文件路径
console.log(__dirname)
app.listen(8888, () => {
console.log('App listening at port 8888')
})

 

//访问127.0.0.1:8888渲染public下index.html文件

posted @ 2017-07-11 17:31  财哥说  阅读(132)  评论(0编辑  收藏  举报