mirror of
https://github.com/FranP-code/countries.git
synced 2025-10-13 00:02:15 +00:00
Merge pull request #12 from trevorblades/heroku
Move service back to Heroku
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,2 +1,2 @@
|
||||
node_modules
|
||||
.netlify
|
||||
.env
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
# Countries GraphQL API
|
||||
|
||||
[](https://github.com/trevorblades/countries/actions)
|
||||
[](https://app.netlify.com/sites/wonderful-bartik-c66edf/deploys)
|
||||
[](CODE_OF_CONDUCT.md)
|
||||
|
||||
A public GraphQL API for information about countries, continents, and languages. This project uses [Countries List](https://annexare.github.io/Countries/) as a data source, so the schema follows the shape of that data, with a few exceptions:
|
||||
A public GraphQL API for information about countries, continents, and languages. This project uses [Countries List](https://annexare.github.io/Countries/) and [`provinces`](https://github.com/substack/provinces) as data sources, so the schema follows the shape of that data, with a few exceptions:
|
||||
|
||||
1. The codes used to key the objects in the original data are available as a `code` property on each item returned from the API.
|
||||
2. The `continent` and `languages` properties are now objects and arrays of objects, respectively.
|
||||
3. Each `Country` has an array of `states` populated by their states/provinces, if any.
|
||||
|
||||
## Writing queries
|
||||
|
||||
@@ -62,5 +62,3 @@ Check out [the playground](https://countries.trevorblades.com) to explore the sc
|
||||
## License
|
||||
|
||||
[MIT](./LICENSE)
|
||||
|
||||
[](https://www.netlify.com)
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
/ /.netlify/functions/graphql 200!
|
||||
@@ -1,5 +1,5 @@
|
||||
const provinces = require('provinces');
|
||||
const {ApolloServer, gql} = require('apollo-server-lambda');
|
||||
const {ApolloServer, gql} = require('apollo-server');
|
||||
const {continents, countries, languages} = require('countries-list');
|
||||
|
||||
const typeDefs = gql`
|
||||
@@ -136,8 +136,6 @@ const server = new ApolloServer({
|
||||
}
|
||||
});
|
||||
|
||||
exports.handler = server.createHandler({
|
||||
cors: {
|
||||
origin: '*'
|
||||
}
|
||||
server.listen({port: process.env.PORT}).then(({url}) => {
|
||||
console.log(`🚀 Server ready at ${url}`);
|
||||
});
|
||||
@@ -1,3 +0,0 @@
|
||||
[build]
|
||||
command = "noop"
|
||||
functions = "functions"
|
||||
1297
package-lock.json
generated
1297
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,13 +1,14 @@
|
||||
{
|
||||
"scripts": {
|
||||
"pretest": "eslint functions",
|
||||
"start": "nodemon -r dotenv/config index.js",
|
||||
"pretest": "eslint index.js apollo.config.js",
|
||||
"test": "echo \"Error: no test specified\" && exit"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "@trevorblades"
|
||||
},
|
||||
"dependencies": {
|
||||
"apollo-server-lambda": "^2.10.0",
|
||||
"apollo-server": "^2.10.1",
|
||||
"countries-list": "^2.4.3",
|
||||
"graphql": "^14.6.0",
|
||||
"provinces": "^1.11.0"
|
||||
@@ -15,7 +16,8 @@
|
||||
"devDependencies": {
|
||||
"@trevorblades/eslint-config": "^7.0.1",
|
||||
"apollo": "^2.16.0",
|
||||
"dotenv": "^8.2.0",
|
||||
"eslint": "^6.2.1",
|
||||
"noop-cli": "^1.0.0"
|
||||
"nodemon": "^2.0.2"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user