-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
42 lines (33 loc) · 1.05 KB
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Define Dependencies
const Express = require('express');
const app = Express();
// Define Variables
const { port } = require('./settings/config.json');
// Define Listeners
app.get('/', (req, res) => {
res.status(200).send("hello, world.");
});
app.get('/api/artists/', (req, res) => {
res.status(200).send({ "error": "Unable to fetch data." });
});
app.get('/api/verified', (req, res) => {
res.status(200).send({ "error": "Unable to fetch data." });
});
app.get('/api/developers', (req, res) => {
res.status(200).send({ "success": "BookishWaffle" });
});
app.get("/api/contributors", (req, res) => {
res.status(200).send({ "success": "Artucuno1234" });
});
app.use('*', (req, res) => {
res.status(404).send("File was not found on the server.");
});
/*
# Example
- To return the service developers: `http://localhost:3000/api/developers/`
- To return the service contributors: `http://localhost:3000/api/contributors/`
*/
// Define Listener Starter
const listener = app.listen(port, () => {
console.log('Service API has started.');
});