server: remove home page + do not use /p/ route but / instead (closes #290408)

authorSamuel Trégouët <samuel.tregouet@logilab.fr>
changesetab32817bf7a0
branchdefault
phasepublic
hiddenno
parent revision#5037f221d1eb xmosaicframe: fill form partially with initial dataset (if exist)
child revision#c9a281b0b5c5 xmosaicframe: move frame menu from top to right (related to #290425)
files modified by this revision
app/assets/index.html
mosaicserver/app.js
mosaicserver/routes.js
# HG changeset patch
# User Samuel Trégouët <samuel.tregouet@logilab.fr>
# Date 1428044626 -7200
# Fri Apr 03 09:03:46 2015 +0200
# Node ID ab32817bf7a0fe34ae9f20226d5eee6b48d6ea9f
# Parent 5037f221d1eb1014d43776f534d2a351df72c47e
server: remove home page + do not use /p/ route but / instead (closes #290408)

diff --git a/app/assets/index.html b/app/assets/index.html
@@ -1,38 +0,0 @@
1 -<!doctype html>
2 -<html lang="en">
3 -  <head>
4 -    <meta charset="UTF-8"/>
5 -    <title>Portfolio design</title>
6 -    <script src="webcomponents.js"></script>
7 -    <script src="babel-browser-polyfill.js"></script>
8 -    <link rel="stylesheet" href="vendor.css"/>
9 -    <link rel="stylesheet" href="app.css"/>
10 -    <script src="vendor.js"></script>
11 -    <link rel="import" href="components/xmosaicframe/xmosaicframe.html" />
12 -    <link rel="import" href="components/neotableview/neotableview.html" />
13 -    <link rel="import" href="components/neolistview/neolistview.html" />
14 -    <link rel="import" href="components/markdown-editable/markdown-editable.html" />
15 -    <link id="list" rel="import" href="templates/list.html" />
16 -  </head>
17 -  <body>
18 -    <div class="container">
19 -      <h1>Portfolio example</h1>
20 -      <div class="mosaic-main-control">
21 -        <div class="form-group">
22 -          <textarea id="initialq" class="form-control" name="q" rows="3" cols="120">MATCH (n:`DOCUMENT`) RETURN n LIMIT 25</textarea>
23 -        </div>
24 -        <button id="addFrame" class="btn btn-primary">add a frame</button>
25 -        <button id="addText" class="btn">add text</button>
26 -      </div>
27 -      <div id="frames"></div>
28 -
29 -    </div>
30 -    <div class="content"></div>
31 -
32 -    <!-- scripts -->
33 -    <script src="data.js"></script>
34 -    <script src="views.js"></script>
35 -    <script src="app.js"></script>
36 -    <script>require('portfolio').init();</script>
37 -  </body>
38 -</html>
diff --git a/mosaicserver/app.js b/mosaicserver/app.js
@@ -21,11 +21,11 @@
39  // XXX hardcoded '../public' path, it should use a config variable.
40  //     This variable could be set to the ``path`` parameter of the
41  //     startServer callback for instance.
42  app.use(express.static(path.join(__dirname, '../public')));
43  app.use('/components/', express.static(path.join(__dirname, '../components')));
44 -app.use('/p/', routes);
45 +app.use('/', routes);
46 
47  if (app.get('env') === 'development') {
48      app.use('/tests/', express.static(path.join(__dirname, '../test')));
49  }
50 
diff --git a/mosaicserver/routes.js b/mosaicserver/routes.js
@@ -31,11 +31,11 @@
51          filename = path.join(__dirname, '/../portfolios/' + slug + '.html'),
52          template = path.join(__dirname, '/../portfolios/_template.html');
53      var istream = fs.createReadStream(template),
54          ostream = fs.createWriteStream(filename);
55      ostream.on('finish', function() {
56 -        res.redirect('/p/' + slug);
57 +        res.redirect('/' + slug);
58      });
59      ostream.on('error', function () {
60          res.status(500).send('could not create resource');
61          next();
62      });