Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
lovelace
webLovelace
Commits
3f11a4ec
Commit
3f11a4ec
authored
Jul 15, 2017
by
Alejandro E. Rendon
Browse files
init api
parent
10300551
Changes
2
Hide whitespace changes
Inline
Side-by-side
app.js
View file @
3f11a4ec
...
...
@@ -15,6 +15,7 @@ const express = require('express'),
require
(
'
colors
'
);
const
index
=
require
(
'
./routes/index
'
);
const
api
=
require
(
'
./routes/api
'
);
const
user
=
require
(
'
./routes/user
'
);
const
admin
=
require
(
'
./routes/admin
'
);
...
...
@@ -60,6 +61,7 @@ app.use(express.static(path.join(__dirname, 'public')));
app
.
use
(
methodOverride
(
'
_method
'
));
app
.
use
(
'
/
'
,
index
);
app
.
use
(
'
/api
'
,
api
);
app
.
use
(
'
/user
'
,
user
);
app
.
use
(
'
/admin
'
,
admin
);
// app.use('/users', users);
...
...
routes/api.js
0 → 100644
View file @
3f11a4ec
const
express
=
require
(
'
express
'
);
const
router
=
express
.
Router
();
// const controllers = require('../controllers');
router
.
get
(
'
/
'
,
(
req
,
res
,
next
)
=>
{
res
.
json
({
confirmation
:
'
success
'
,
message
:
'
Welcome to WebCluster Lovelace API
'
});
});
module
.
exports
=
router
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment