MCPcopy Index your code
hub / github.com/parse-community/parse-server / startServer

Function startServer

spec/HTTPRequest.spec.js:10–37  ·  view source on GitHub ↗
(done)

Source from the content-addressed store, hash-verified

8const httpRequestServer = `http://localhost:${port}`;
9
10function startServer(done) {
11 const app = express();
12 app.use(express.json({ type: '*/*' }));
13 app.get('/hello', function (req, res) {
14 res.json({ response: 'OK' });
15 });
16
17 app.get('/404', function (req, res) {
18 res.status(404);
19 res.send('NO');
20 });
21
22 app.get('/301', function (req, res) {
23 res.status(301);
24 res.location('/hello');
25 res.send();
26 });
27
28 app.post('/echo', function (req, res) {
29 res.json(req.body);
30 });
31
32 app.get('/qs', function (req, res) {
33 res.json(req.query);
34 });
35
36 return app.listen(13371, undefined, done);
37}
38
39describe('httpRequest', () => {
40 let server;

Callers 1

Calls 2

getMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected