1234567891011121314151617181920212223242526272829303132333435 |
- const express = require('express');
- var pjson = require('./package.json');
- const app = express();
- app.get('/api/v1/getNotepad', function (req, res) {
- console.log('Recieved GetNotepad request');
- res.type('json');
- res.send('{"posts": ["post1"]}');
- });
- app.get('/api/v1/ping', function (req, res) {
- console.log('Recieved Ping request');
- res.type('text/plain');
- res.send('pong');
- });
- app.get('/api/v1/info', function (req, res) {
- console.log('Recieved Info request');
- res.type('json');
- var response =
- {
- "version": pjson.version
- };
- res.send(JSON.stringify(response));
- });
- app.get('/', function (req, res) {
- console.log('Recieved / request');
- res.send("");
- });
- app.listen(5312, function () {
- console.log('Listening on port 5312...');
- });
|