Skip to content

eklam/JsonPersister

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JsonPersister.apphb.com is a simple web site that store JSON objects for you. I did it for personal use when I am doing simple web/mobile prototypes, and have to store simple objects in the cloud.

How to use:

{app-id} is an Id assigned by your application, it is simply a prefix to all of your resources. I recommend using a GUID, you can generate you here

{resource-id} is the Id you want to use for the specific resource

Add or Update a resource using POST:

$.ajax({
	type: 'POST',
	url: 'http://jsonpersister.apphb.com/api/values/{app-id}',
	data: { firstName: 'renan', lastName: 'stigliani', email: 'renan@email.com' },
	dataType: 'json',
	success: function(id) {
		console.log('Resorce stored with id: ' + id)
	}
});

Alternatively one can use PUT and specify the resource id:

$.ajax({
	type: 'PUT',
	url: 'http://jsonpersister.apphb.com/api/values/{app-id}/{resource-id}',
	data: { firstName: 'renan', lastName: 'stigliani', email: 'renan@email.com' },
	dataType: 'json',
	success: function(id) {
		console.log('Resorce stored')
	}
});

To GET one specific resource:

$.ajax({
	type: 'GET',
	url: 'http://jsonpersister.apphb.com/api/values/{app-id}/{resource-id}',
	dataType: 'json',
	success: function(data) {
		console.log(data)
	},
});

And to GET all of your resources use:

$.ajax({
	type: 'GET',
	url: 'http://jsonpersister.apphb.com/api/values/{app-id}',
	dataType: 'json',
	success: function(data) {
		console.log(data)
	}
});

To DELETE a resource:

$.ajax({
	type: 'DELETE',
	url: 'http://jsonpersister.apphb.com/api/values/{app-id}/{resource-id}',
	dataType: 'json',
	success: function() {
		console.log('Resorce deleted')
	}
});

To DELETE all of your resources:

$.ajax({
	type: 'DELETE',
	url: 'http://jsonpersister.apphb.com/api/values/{app-id}',
	dataType: 'json',
	success: function() {
		console.log('All resources deleted')
	}
});

About

Simple web site that store JSON objects for you

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published