Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused code #34

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./server/index');
module.exports = require('./server/geoquery');
6,337 changes: 0 additions & 6,337 deletions package-lock.json

This file was deleted.

68 changes: 38 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,40 @@
{
"name": "geoquery",
"version": "0.6.2",
"keywords": [
"util",
"functional",
"server",
"client",
"browser",
"geography",
"places"
],
"author": "Ndifreke Ekim",
"contributors": [],
"dependencies": {
"dotenv": "^8.0.0",
"graphql": "latest"
},
"devDependencies": {
"nodemon": "^1.19.0",
"eslint": "^5.16.0",
"husky": "2.3.0",
"jest": "^24.8.0",
"coveralls": "^3.0.3"
},
"scripts": {
"coveralls": "cat ./coverage/lcov.info | coveralls",
"test": "jest __tests__/index.js --coverage",
"demo": "node server/example",
"nodemon": "nodemon server/example.js"
}
"name": "geoquery",
"version": "0.6.2",
"keywords": [
"util",
"functional",
"server",
"client",
"browser",
"geography",
"places"
],
"author": "Ndifreke Ekim",
"contributors": [],
"dependencies": {
"@babel/types": "^7.14.5",
"dotenv": "^8.0.0",
"graphql": "latest",
"ts-node": "^10.1.0",
"typescript": "^4.3.5"
},
"devDependencies": {
"coveralls": "^3.0.3",
"eslint": "^5.16.0",
"husky": "2.3.0",
"jest": "^27.0.6",
"nodemon": "^2.0.11"
},
"scripts": {
"coveralls": "cat ./coverage/lcov.info | coveralls",
"test": "jest __tests__/index.js --coverage",
"start-server": "ts-node server/createServer.ts",
"demo-server": "ts-node server/demo.ts",
"build": "tsc && npm run postbuild",
"start": "node build/server.js",
"postbuild": "cp -R server/geo-data build/geo-data && cp server/index.html build/index.html",
"watch-server": "nodemon server/createServer.ts",
"type-check": "tsc --noEmit "
}
}
5 changes: 0 additions & 5 deletions server/constant.js

This file was deleted.

10 changes: 10 additions & 0 deletions server/constant.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const path = require('path');
const SERVER_PATH = __dirname;
const DATA_SOURCE_PATH = path.join(SERVER_PATH, './geo-data');

enum DATA_SOURCE_PATH_FOLDERS_NAMES {
CountryState = 'country_state',
CountryStateCity = 'country_state_city'
}

export { DATA_SOURCE_PATH,DATA_SOURCE_PATH_FOLDERS_NAMES };
59 changes: 59 additions & 0 deletions server/createServer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// import { createServer } from 'http'
// const { schemaStructure } = require('./graphql/app');
// const { readFileSync } = require('fs');
// const dotenv = require('dotenv');
// import geoquery from './index';
// //const util = require('./graphql/util');

// //const startBrowser = util.startBrowser;
// dotenv.config();

// const getHTML = function () {
// const htmlTemplate = readFileSync(__dirname + '/index.html');
// const html = htmlTemplate.toString().replace('#graphQLschema', schemaStructure);
// return html;
// };

// const handleGetRequest = function (req, res) {
// res.end(getHTML());
// };

// const handlePostRequest = function (req, res) {
// req.on('data', async (data) => {
// console.log('POST:\n', data.toString());
// const result = await geoquery(data.toString());
// res.end(JSON.stringify(result, null, 2));
// });
// };

// /**
// * start a web browser to demo the project
// */
// const runDemo = function () {

// const app = createServer();

// app.on('request', async function (req, res) {

// switch (req.method) {
// case 'GET':
// handleGetRequest(req, res);
// break;

// case 'POST':
// handlePostRequest(req, res);
// break;
// }
// });

// const PORT = 8080;
// app.listen(PORT);

// console.log(`Listening on`, PORT, `http://localhost:${PORT}`);
// };
// console.log("Running Develep")
// runDemo();


import microServer from './microServer'
microServer({port:8080})
13 changes: 13 additions & 0 deletions server/demo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { demo } from './geoquery'
// demo()

// const util = require('./graphql/util');
// const dotenv = require('dotenv');

// const startBrowser = util.startBrowser;
// dotenv.config();
// import microServer from './microServer'


// microServer({ port: 8080, callback: startBrowser })
demo(8091)
58 changes: 0 additions & 58 deletions server/example.js

This file was deleted.

1 change: 0 additions & 1 deletion server/geo-data/country state data/Nigeria/Abia State.json

This file was deleted.

1 change: 0 additions & 1 deletion server/geo-data/country state data/Niue/Alofi.json

This file was deleted.

This file was deleted.

Loading