gulp stuff

This commit is contained in:
Martin Donnelly 2017-08-07 22:15:19 +01:00
parent e6b89918d0
commit ca959d8923
15 changed files with 66 additions and 8 deletions

20
app.js
View File

@ -16,14 +16,15 @@ const Url = require('./models/url');
let isProduction = false;
let sitePath = 'public';
let index = 'views/index.html';
let indexView = 'views/index.html';
let listView = 'views/list.html';
process.env.NODE_ENV = process.env.NODE_ENV || 'dev';
if (process.env.NODE_ENV === 'prod') {
isProduction = true;
sitePath = 'live';
index = 'dist/index.html'
indexView = 'dist/index.html'
}
logger.warn(`isProduction:${isProduction}`);
@ -50,7 +51,11 @@ app.all('/*', function(req, res, next) {
});
app.get('/', function(req, res){
res.sendFile(path.join(__dirname, index));
res.sendFile(path.join(__dirname, indexView));
});
app.get('/admin/list', function(req, res){
res.sendFile(path.join(__dirname, listView));
});
app.post('/api/v1/shorten', function(req, res){
@ -87,6 +92,15 @@ app.post('/api/v1/shorten', function(req, res){
});
app.get('/api/v1/list', function(req, res){
Url.find({}, function(err, doc) {
if (doc) {
logger.debug(doc);
}
})
});
app.get('/:encoded_id', function(req, res){
const base58Id = req.params.encoded_id;

View File

@ -1,8 +1,8 @@
const config = {};
config.db = {};
config.webhost = 'http://nurl.co/';
// config.webhost = 'http://localhost:7000/';
// config.webhost = 'http://nurl.co/';
config.webhost = 'http://localhost:7000/';
config.port = 7000;
config.db.host = 'localhost';

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
fav/apple-touch-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

9
fav/browserconfig.xml Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>
</browserconfig>

BIN
fav/favicon-16x16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 B

BIN
fav/favicon-32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
fav/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

18
fav/manifest.json Normal file
View File

@ -0,0 +1,18 @@
{
"name": "",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}

BIN
fav/mstile-150x150.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -0,0 +1 @@
<svg version="1" xmlns="http://www.w3.org/2000/svg" width="3046.667" height="3046.667" viewBox="0 0 2285.000000 2285.000000"><path d="M1646 115.6c-23.1 1.9-29.9 2.7-32.5 3.4-1.6.5-5.5 1.2-8.5 1.5-3 .4-7.3 1-9.5 1.5s-6 1.1-8.5 1.5c-15.2 2.1-53.5 13.6-77 23-13.6 5.4-52.8 24.8-55.7 27.4-1 1-3 2.4-4.4 3.1-4.6 2.5-28.4 18.4-34.3 22.9-24.4 19-38.6 32.9-328.7 323-164.2 164.2-300.3 300.8-302.5 303.6-2.1 2.7-7.1 8.6-10.9 13-8.8 10-34.4 46.2-36.3 51.4-.3.9-2.4 4.7-4.8 8.6-24 40.1-43.9 99.6-50.8 152.5-8.1 61.2-3.1 118.8 15.9 183 6.1 20.8 19.1 51.6 31.8 75.3 2 3.6 15.4 25.5 22.1 36.1 19.2 30.1 48.3 64 75.9 88.3 10.7 9.4 11.9 10.2 14 9.2 2.8-1.5 181.7-180.6 181.7-181.9 0-.6-3-3-6.7-5.3-11.1-7.1-21.1-15.7-34.8-29.9-26.6-27.4-41.8-57.1-47.5-92.8-3.3-20.4-1.6-51.1 3.6-68.5 7.9-26 15.3-41.1 30.3-61.5 7.5-10.4 584-586.9 597.1-597.2 15.2-11.9 24.4-17.3 41.2-24.1 36.8-14.8 82.1-15.6 120-2.1 17.8 6.4 50.5 23.8 58.9 31.5 1.5 1.3 4.7 4.1 7.3 6.2 6.7 5.5 20.3 21.1 26.3 30.3 2.9 4.3 5.8 8.5 6.4 9.2 2.6 3.1 11.4 22.4 14.5 31.9 5.2 16.2 6.7 25.8 6.7 42.3-.2 22.4-4.1 42.9-12 63-2.9 7.4-8.2 18.2-9.3 19-.4.3-2.4 3.2-4.5 6.5-4.7 7.5-12.8 18.8-17.3 24-1.9 2.2-55.7 56.3-119.5 120.2-109.8 110-115.9 116.3-115.3 119 .4 1.5 2.7 6.8 5.1 11.8 15 30.9 32.5 88.9 38.9 128.5 2.3 14.6 3.2 21.8 5.6 47 2.1 21.6 1.2 69.7-1.9 100.9-.5 4.7-.7 9.1-.4 9.8.3.7 1.9 1.3 3.5 1.3 2.5 0 5-1.8 13.2-9.8 5.7-5.3 12.2-11.1 14.7-12.7 2.4-1.7 7.8-5.5 11.9-8.5 8.6-6.3 318.2-315.4 337.1-336.6 12.2-13.6 34.3-42.4 41.9-54.6 5.2-8.4 9.1-15.2 16.7-29.8 3.1-5.8 6.6-12.3 7.8-14.5 5.7-9.9 21.4-51 25.7-67 1-3.9 2.1-7.7 2.3-8.5 12.5-44.8 17.5-104.4 12.5-149-1.5-13.3-4.9-34.1-6-36.5-.5-1.1-1.4-4.5-2-7.5-4-18.5-13.5-49.5-18.8-61.1-1.1-2.4-3.4-7.9-5.1-12.1-1.7-4.3-3.5-8.6-4.1-9.5-.5-1-3.9-7.8-7.4-15.1-3.6-7.2-7-13.8-7.6-14.5-.9-1-10.3-16.5-15.9-26-.9-1.6-3.1-4.8-4.8-7-1.8-2.3-3.3-4.6-3.3-5 0-.4-2.8-4.2-6.3-8.5-3.5-4.2-8.2-10.2-10.4-13.2-2.2-3-6.9-8.7-10.5-12.5-3.6-3.9-6.7-7.5-6.9-8.1-.8-2.1-31.4-30.9-41.3-38.9-18.8-15.1-35.6-27.5-37.5-27.5-.6 0-2.5-1.3-4.3-2.9-3.6-3.1-21.5-14.1-27.5-16.9-2.1-.9-4-2-4.3-2.3-.7-.8-31.2-15.2-38.5-18.1-3.3-1.3-8.2-3-11-3.8-2.7-.7-5.2-1.7-5.5-2-1.2-1.7-41.4-13.5-53-15.6-2.5-.4-4.7-.8-5-.9-.3-.1-2.5-.5-5-.9-2.5-.5-5.4-1-6.5-1.3-8.4-1.8-32-5.7-41-6.9-10.6-1.3-58.2-2.6-67.5-1.8z"/><path d="M1276.7 853.9c-49.3 49.4-89.7 90.6-89.7 91.4 0 .8 2.1 2.7 4.8 4.3 16.8 9.7 34.9 24.2 36.7 29.3.6 1.5 4.7 6.8 9.3 11.8 15.2 16.6 20.9 25 27.5 40.4 9.5 22.2 13.8 43 13.8 67.6 0 39.4-11.3 72.2-36 104.3-5.7 7.4-129.4 131.8-542.1 545.1-57.9 58-62.3 61.9-81 72.9-3 1.8-5.7 3.6-6 4-1 1.5-14.4 7.2-25.9 11.1-14 4.6-30.1 7.5-47.1 8.4-18.5 1-35.3-1.4-52.3-7.4-8.7-3.1-24.7-10.8-24.7-12 0-.5-1-1.3-2.2-1.7-3.2-1-15.7-9.5-23.7-16.1-11.7-9.8-26.6-26.9-33.8-39.1-5.6-9.5-10.1-18.2-11.3-21.8-.7-2.1-1.6-4.1-2-4.4-1.1-.8-8.5-19.5-10.9-27.8-8.5-28.4-8.9-62.1-1.1-92.4 2.3-9 9.2-26.7 12.3-31.8 1.2-1.9 2.7-4.2 3.2-5.2 13.5-23 13.8-23.2 136.4-146.1 63.6-63.6 115.8-116.2 116-116.8.6-1.9-2.2-10.2-10.6-31.2-14-35.1-22.3-63.7-29.9-102.4-4.2-22.1-8.4-61.2-8.4-80.1 0-6.9-.6-10.1-3.6-19l-3.6-10.7.6-15.5c.4-8.5 1.2-20.3 1.9-26.1l1.3-10.7h-11.2l-178.5 178.7c-191.7 191.8-191.6 191.7-212.8 223.1-15.1 22.4-25.5 40.9-35.7 63.8-3.6 8.1-7.5 16.6-8.5 19-3 6.5-11.5 32.3-14.8 44.7-11.8 44-17.5 100.4-13.7 134.5.3 1.9.7 7.3 1 12 .6 7.6 3 28.3 4 33.5.2 1.1.7 4.5 1.1 7.5 3.1 25.7 12.5 60.5 25.3 93.5 5.1 13.1 24.1 52 29.3 60 11.9 18.2 15.2 22.9 17.4 25.3 1.4 1.5 2.5 3.1 2.5 3.5 0 1.3 9.6 14.7 14.1 19.7 2.2 2.5 9.2 10.3 15.4 17.5 12.1 13.9 22.2 24 35 35 4.4 3.8 9.1 7.9 10.5 9.2 2.2 1.9 6.4 5.3 18 14.1 6.5 4.9 34.2 23.3 39.5 26.2 18.9 10.3 42.7 21.9 54.5 26.5 13.5 5.3 35.4 12.6 42 14 1.9.4 3.7 1.1 4 1.5 1.8 2.4 44.7 10.3 65.4 12 16.2 1.3 54.3 1.3 70.1 0 24.7-2 57.6-7.6 77-13.2 23-6.5 34.5-10.3 38-12.4 1.1-.6 3.1-1.5 4.5-1.9 8.5-2.5 36.2-15.3 54.4-25.2 19-10.4 56.6-36.4 66-45.6 1.6-1.6 6.6-5.9 11-9.7 4.5-3.8 75-73.8 156.7-155.7 266.6-267 448.6-449.7 453.6-455.4 15.7-17.6 33.6-41.7 43.9-58.9 3.1-5.2 7.2-12.1 9.1-15.3 7.6-12.7 21.5-42 26.2-55.2 1.8-5 3.6-9.9 4.1-11 2.6-5.7 7.6-22 11.5-37.6 9.8-39 13.6-69.5 13.4-107.9-.2-29.7-1.7-46.4-6.5-73.5-3.8-20.8-15.6-65.4-18.4-69-.4-.6-1.7-3.9-3-7.5-3.3-9.7-9.5-24.1-15.8-36.5-12.4-24.4-36.1-59.1-55.1-80.5-11.6-13.1-29.4-31-30.9-31-.7 0-7.5-5.5-15-12.3-15-13.5-24.8-21.7-26.1-21.7-.4 0-41.1 40.4-90.4 89.9z"/></svg>

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -67,8 +67,8 @@ gulp.task('styles', function() {
gulp.task('migrate', function() {
return gulp.src(['bower_components/mui/packages/cdn/css/mui.min.css'])
.pipe(gulp.dest('live/css'));
return gulp.src(['fav/*'])
.pipe(gulp.dest('dist'));
});
gulp.task('index', function() {
@ -102,5 +102,5 @@ gulp.task('buildJS', function() {
gulp.task('default', ['clean'], function() {
//gulp.start('buildJS','styles','index');
gulp.start('buildJS','styles', 'index');
gulp.start('buildJS','styles', 'index', 'migrate');
});

View File

@ -6,6 +6,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>nURL</title>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="theme-color" content="#ffffff">
<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed" rel="stylesheet">
<!-- build:css-->
<link rel="stylesheet" href="//cdn.muicss.com/mui-0.9.20/css/mui.min.css">

10
views/list.html Normal file
View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>