From e0dcacec4441aa0e51f5c632e7dc0c33c7a27157 Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 15 Mar 2017 14:14:10 +0800 Subject: [PATCH] node server --- index.html | 12 ++++++------ package.json | 11 ++++++----- server.js | 13 +++++++++++++ 3 files changed, 25 insertions(+), 11 deletions(-) create mode 100644 server.js diff --git a/index.html b/index.html index 66a8337285..ab42c33716 100644 --- a/index.html +++ b/index.html @@ -5,14 +5,14 @@ + href="./dist/core.css"/> + href="./dist/base.css"/> - - - - + + + +
diff --git a/package.json b/package.json index e4eae52c2f..04d5cb78e0 100644 --- a/package.json +++ b/package.json @@ -3,19 +3,20 @@ "version": "1.0.0", "description": "fineui", "main": "index.js", - "dependencies": { - - }, + "dependencies": {}, "devDependencies": { + "express": "^4.15.2", "grunt": "^1.0.1", "grunt-contrib-concat": "^1.0.1", "grunt-contrib-cssmin": "^1.0.1", "grunt-contrib-jshint": "^1.0.0", "grunt-contrib-uglify": "^1.0.1", - "grunt-contrib-watch": "^1.0.0" + "grunt-contrib-watch": "^1.0.0", + "open": "0.0.5" }, "scripts": { - "grunt": "grunt" + "grunt": "grunt", + "start": "node server.js" }, "author": "", "license": "MIT" diff --git a/server.js b/server.js new file mode 100644 index 0000000000..a9fd0cedeb --- /dev/null +++ b/server.js @@ -0,0 +1,13 @@ +/*eslint no-console:0 */ +'use strict'; +const express = require('express'); +const open = require('open'); +const fs=require("fs"); +const app = express(); +const port = 3000; + +app.use(express.static("./")); +app.listen(port, function() { + console.log("server start"); + open('http://localhost:' + port + '/index.html'); +});