Move the upload dir (physically) to public
This commit is contained in:
parent
ba5ede6463
commit
b93461271e
4 changed files with 4 additions and 5 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1 +1 @@
|
||||||
upload/*
|
public/upload/*
|
||||||
|
|
6
plemp.js
6
plemp.js
|
@ -14,11 +14,11 @@ var express = require("express"),
|
||||||
|
|
||||||
// Set up the Node Express application.
|
// Set up the Node Express application.
|
||||||
var app = express.createServer(form({ keepExtensions: true,
|
var app = express.createServer(form({ keepExtensions: true,
|
||||||
uploadDir: __dirname + '/upload' }));
|
uploadDir: __dirname + '/public/upload' }));
|
||||||
|
|
||||||
var draggables = {};
|
var draggables = {};
|
||||||
// Initialise the draggables info.
|
// Initialise the draggables info.
|
||||||
fs.readdir(__dirname + '/upload', function (err, files) {
|
fs.readdir(__dirname + '/public/upload', function (err, files) {
|
||||||
if (err)
|
if (err)
|
||||||
throw(err)
|
throw(err)
|
||||||
for (var i in files) {
|
for (var i in files) {
|
||||||
|
@ -46,7 +46,7 @@ app.get('/', function(req, res) {
|
||||||
// The draggable route: provides direct access to the HTML generating code
|
// The draggable route: provides direct access to the HTML generating code
|
||||||
// for draggable objects.
|
// for draggable objects.
|
||||||
app.get('/draggable/:id', function(req, res) {
|
app.get('/draggable/:id', function(req, res) {
|
||||||
var file = "upload/" + req.params.id;
|
var file = "public/upload/" + req.params.id;
|
||||||
// Stuff taken from the Camping implementation.
|
// Stuff taken from the Camping implementation.
|
||||||
drag = draggables[req.params.id];
|
drag = draggables[req.params.id];
|
||||||
var default_style = "left:" + drag.left + "px;top:" + drag.top + "px;";
|
var default_style = "left:" + drag.left + "px;top:" + drag.top + "px;";
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
../upload
|
|
Reference in a new issue