diff --git a/README.md b/README.md index 0ac0960..62125b9 100644 --- a/README.md +++ b/README.md @@ -33,3 +33,9 @@ After that you will have a ready to deploy bundle at `/dist` ## Contributing Have a lot of experience with Webpack and suggestions on how we could improve this starter template? We'd love a PR! + +## Run on Glitch + +1. Open console in Advanced Options. +2. Tailwind needs access to Webpack to work. To allow this, copy the following command into terminal: ```chmod -R u+x node_modules/webpack/bin```. You only need to do this once per session. +3. To start Tailwind: ```npm run dev```. diff --git a/package.json b/package.json index 013202b..8880943 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,8 @@ "private": true, "scripts": { "dev": "cross-env NODE_ENV=development webpack-dev-server", - "prod": "cross-env NODE_ENV=production webpack --no-progress" + "prod": "cross-env NODE_ENV=production webpack --no-progress", + "start": "node server.js" }, "devDependencies": { "cross-env": "^5.1", @@ -12,7 +13,7 @@ "postcss": "^6.0.19", "postcss-loader": "^2.1.1", "style-loader": "^0.20.3", - "tailwindcss": ">=0.6.5", + "tailwindcss": ">=0.6.6", "webpack": "^4.1.1", "webpack-cli": "^2.0.12", "webpack-dev-server": "^3.1.1" diff --git a/server.js b/server.js new file mode 100644 index 0000000..575caa4 --- /dev/null +++ b/server.js @@ -0,0 +1,22 @@ +// server.js +// where your node app starts + +// init project +var express = require('express'); +var app = express(); + +// we've started you off with Express, +// but feel free to use whatever libs or frameworks you'd like through `package.json`. + +// http://expressjs.com/en/starter/static-files.html +app.use(express.static('src')); + +// http://expressjs.com/en/starter/basic-routing.html +app.get("/", function (request, response) { + response.sendFile(__dirname + '/index.html'); +}); + +// listen for requests :) +var listener = app.listen(process.env.PORT, function () { + console.log('Your app is listening on port ' + listener.address().port); +});